• Stefan Roese's avatar
    Kconfig: Enable usage of escape char '\' in string values · 20c20826
    Stefan Roese authored
    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: 's avatarStefan Roese <sr@denx.de>
    Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
    Reviewed-by: 's avatarSimon Glass <sjg@chromium.org>
    Cc: Tom Rini <trini@konsulko.com>
    20c20826
Name
Last commit
Last update
..
basic Loading commit data...
kconfig Loading commit data...
.gitignore Loading commit data...
Kbuild.include Loading commit data...
Lindent Loading commit data...
Makefile Loading commit data...
Makefile.autoconf Loading commit data...
Makefile.build Loading commit data...
Makefile.clean Loading commit data...
Makefile.extrawarn Loading commit data...
Makefile.host Loading commit data...
Makefile.lib Loading commit data...
Makefile.spl Loading commit data...
Makefile.uncmd_spl Loading commit data...
binutils-version.sh Loading commit data...
checkpatch.pl Loading commit data...
checkstack.pl Loading commit data...
cleanpatch Loading commit data...
docproc.c Loading commit data...
dtc-version.sh Loading commit data...
fill_scrapyard.py Loading commit data...
gcc-stack-usage.sh Loading commit data...
gcc-version.sh Loading commit data...
get_maintainer.pl Loading commit data...
kernel-doc Loading commit data...
ld-version.sh Loading commit data...
mailmapper Loading commit data...
mkmakefile Loading commit data...
objdiff Loading commit data...
setlocalversion Loading commit data...
show-gnu-make Loading commit data...