[U-Boot] [PATCH 1/2] hwconfig: Fix stop characters parsing for subkeys

Wolfgang Denk wd at denx.de
Tue Jun 29 22:24:26 CEST 2010


Dear Anton Vorontsov,

In message <20100618110812.GA26595 at oksana.dev.rtsoft.ru> you wrote:
> For the following hwconfig string:
> 
>   key1:subkey1=value1,subkey2=value2;key2:value3
> 
> The subkey2 cannot be extracted correctly. The parsing code looks
> for comma as a stopch, but there may be two kind of stop characters:
> a comma and a semicolon.
> 
> Currently the code would return "value2;key2:value3", while just
> "value2" is the correct answer.
> 
> This patch fixes the issue by making the code aware of multiple
> stop characters.
> 
> For old U-Boots, the issue can be workarounded by placing a comma
> before a semicolon, i.e.:
> 
>   hwconfig=key1:subkey1=value1,subkey2=value2,;key2:value3
> 
> Reported-by: York Sun <yorksun at freescale.com>
> Signed-off-by: Anton Vorontsov <avorontsov at mvista.com>
> ---
>  common/hwconfig.c |   19 ++++++++++---------
>  1 files changed, 10 insertions(+), 9 deletions(-)

Applied to "next" branch.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A supercomputer is a machine that runs an endless loop in 2 seconds.


More information about the U-Boot mailing list