[U-Boot] [U-Boot, v3, 1/4] Kconfig: Enable usage of escape char '\' in string values

Tom Rini trini at konsulko.com
Wed May 27 23:58:49 CEST 2015


On Mon, May 18, 2015 at 02:08:21PM +0200, Stefan Roese wrote:

> I might have missed something, but I failed to use the escape char '\'
> in strings. To pass a printf format string like "foo %d bar\n" via
> Kconfig to the code.
> 
> Right now its not possible to use the escape character '\' in Kconfig
> string values correctly to e.g. set this string value "test output\n".
> The '\n' will be converted to 'n'.
> 
> The current implementation removes some of the '\' chars from the input
> string in conf_set_sym_val(). Examples:
> 
> '\'	-> ''
> '\\'	-> '\'
> '\\\'	-> '\'
> '\\\\'	-> '\\'
> ...
> 
> And then doubles the backslash chars in the output string in
> sym_escape_string_value(). Example:
> 
> '\'	-> ''	-> ''
> '\\'	-> '\'	-> '\\'
> '\\\'	-> '\'	-> '\\'
> '\\\\'	-> '\\'	-> '\\\\'
> ...
> 
> As you see in these examples, its impossible to generate a single '\'
> charater in the output string as its needed for something like '\n'.
> 
> This patch now changes this behavior to not drop some backslashes in
> conf_set_sym_val() and to not add new backslashes in the resulting
> output string. Removing the function sym_escape_string_value()
> completely as its not needed anymore.
> 
> Signed-off-by: Stefan Roese <sr at denx.de>
> Cc: Masahiro Yamada <yamada.masahiro at socionext.com>
> Cc: Simon Glass <sjg at chromium.org>
> Reviewed-by: Simon Glass <sjg at chromium.org>

This breaks a number of configs such as TZX-Q8-713B7_defconfig:
*** Error in `scripts/kconfig/conf': free(): invalid next size (fast):
0x0000000002972420 ***
../scripts/kconfig/Makefile:111: recipe for target 'TZX-Q8-713B7_defconfig' failed

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150527/3b86b2a5/attachment.sig>


More information about the U-Boot mailing list