Re: [PATCH 2/2] scripts/config: print string values literally with --state

From: Julian Braha

Date: Tue Dec 01 2026 - 13:07:14 EST


On 11/30/26 07:52, Daniel Syauqi wrote:
> With CONFIG_LOCALVERSION="-n", querying --state LOCALVERSION exits

Again, this example is quite contrived.

> successfully without printing any bytes. Bash's echo interprets the
> decoded string as an option. Values such as "-e" yield only a newline.
>
> Use printf with a fixed format so that each query produces the value
> followed by a newline, including when multiple queries are chained.
>
> Fixes: d6686da814c8 ("scripts/config: properly report and set string options")

I don't think improvements in input validation warrants a Fixes tag.

> Signed-off-by: Daniel Syauqi <syauqicode@xxxxxxxxx>
> ---
> scripts/config | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/config b/scripts/config
> index ba66b681d..143dae061 100755
> --- a/scripts/config
> +++ b/scripts/config
> @@ -214,7 +214,7 @@ while [ "$1" != "" ] ; do
> V="${V/%\"/}"
> V="${V//\\\"/\"}"
> V="${V//\\\\/\\}"
> - echo "${V}"
> + printf '%s\n' "$V"
> fi
> fi
> ;;
>

Tested-by: Julian Braha <julianbraha@xxxxxxxxx>
Reviewed-by: Julian Braha <julianbraha@xxxxxxxxx>

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature