1
0
Fork 0
remarkable-uboot/scripts/kconfig
Stefan Roese 20c20826ef Kconfig: Enable usage of escape char '\' in string values
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@denx.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2015-06-08 10:45:04 -04:00
..
lxdialog kbuild: Make scripts executable 2014-11-12 13:25:42 -05:00
.gitignore kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
Makefile kbuild: remove scripts/multiconfig.sh 2015-03-28 09:03:08 -04:00
POTFILES.in kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
check.sh kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
conf.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
confdata.c Kconfig: Enable usage of escape char '\' in string values 2015-06-08 10:45:04 -04:00
expr.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
expr.h kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
gconf.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
gconf.glade kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
images.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
kxgettext.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
list.h kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
lkc.h kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
lkc_proto.h kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
mconf.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
menu.c kconfig: Fix warning "‘jump’ may be used uninitialized" 2014-12-08 09:35:48 -05:00
merge_config.sh Correct two non-functional misspellings "overrided". 2014-10-27 17:54:11 -04:00
nconf.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
nconf.gui.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
nconf.h kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
qconf.cc kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
qconf.h kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
streamline_config.pl kbuild: Make scripts executable 2014-11-12 13:25:42 -05:00
symbol.c Kconfig: Enable usage of escape char '\' in string values 2015-06-08 10:45:04 -04:00
util.c kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
zconf.gperf kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
zconf.hash.c_shipped kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
zconf.l kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
zconf.lex.c_shipped kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
zconf.tab.c_shipped kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00
zconf.y kconfig: import Kconfig files from Linux 3.16-rc7 2014-07-30 08:47:46 -04:00