https://lore.kernel.org/dash/avRFkg95wTMWt9i8@gondor.apana.org.au/ From 44ec2110f4983aaaff59b5b07f3379e85b28ed53 Mon Sep 17 00:00:00 2001 Message-ID: <44ec2110f4983aaaff59b5b07f3379e85b28ed53.1796087483.git.sam@gentoo.org> From: Herbert Xu Date: Wed, 11 Nov 2026 18:38:10 +0800 Subject: [PATCH] expand: Drop incorrect CTLESC cast in argstr CTLESC needs to be cast to char when it's compared against a char value. However, when it is compared against an integer that was promoted from signed char, it must not be cast. Reported-by: Anders Kaseorg Fixes: 6c44f4ee0c2b ("parser: Add support for multi-byte characters") Signed-off-by: Herbert Xu Tested-by: Anders Kaseorg --- src/expand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expand.c b/src/expand.c index 7ebb841..b0f6cf8 100644 --- a/src/expand.c +++ b/src/expand.c @@ -372,7 +372,7 @@ addquote: ml = (mb >> 8) - 2; if (flag & (QUOTES_ESC | EXP_MBCHAR)) { length = (mb >> 8) + (mb & 0xff); - if (c == (char)CTLESC) + if (c == CTLESC) startloc += length; break; } -- 2.56.1