public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, v3, 1/4] Kconfig: Enable usage of escape char '\' in string values
Date: Fri, 29 May 2015 09:14:02 +0200	[thread overview]
Message-ID: <556811BA.6000309@denx.de> (raw)
In-Reply-To: <20150527215849.GD18689@bill-the-cat>

On 27.05.2015 23:58, Tom Rini wrote:
> 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@denx.de>
>> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> Reviewed-by: Simon Glass <sjg@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

Hmmm. I've not seen this error while running buildman for all ARM 
boards. Sorry about that. I'll work on a new version later today.

Thanks,
Stefan

  reply	other threads:[~2015-05-29  7:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 12:08 [U-Boot] [PATCH v3 0/4] Add SHA256 encrypted stop string for autobooting Stefan Roese
2015-05-18 12:08 ` [U-Boot] [PATCH v3 1/4] Kconfig: Enable usage of escape char '\' in string values Stefan Roese
2015-05-18 21:40   ` Simon Glass
2015-05-27 21:58   ` [U-Boot] [U-Boot, v3, " Tom Rini
2015-05-29  7:14     ` Stefan Roese [this message]
2015-05-29  9:47   ` [U-Boot] [PATCH v4 " Stefan Roese
2015-06-08 21:53     ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-05-18 12:08 ` [U-Boot] [PATCH v3 2/4] autoboot.c: Remove CONFIG_AUTOBOOT_STOP_STR2 and CONFIG_AUTOBOOT_DELAY_STR2 Stefan Roese
2015-06-08 21:53   ` [U-Boot] [U-Boot, v3, " Tom Rini
2015-05-18 12:08 ` [U-Boot] [PATCH v3 3/4] autoboot.c: Move config options to Kconfig Stefan Roese
2015-06-08 21:53   ` [U-Boot] [U-Boot, v3, " Tom Rini
2015-05-18 12:08 ` [U-Boot] [PATCH v3 4/4] autoboot.c: Add feature to stop autobooting via SHA256 encrypted password Stefan Roese
2015-06-08 21:53   ` [U-Boot] [U-Boot, v3, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556811BA.6000309@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox