aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-01-13 19:14:27 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-01-13 19:14:27 +0100
commit9809a82b5983ac3184906fff2df48765dab372c8 (patch)
treec546d6d19616ebdc0bef6bf0cb48a067816ee586 /shell/hush.c
parent6606c519efa9a74c53bf05e53e07a8d8f0eb37c7 (diff)
downloadbusybox-9809a82b5983ac3184906fff2df48765dab372c8.tar.gz
hush: fix raw ^C handlisg in single-quoted strings
function old new delta parse_stream 2719 2754 +35 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index fc8940d3d..79d7a53dd 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -5225,6 +5225,11 @@ static struct pipe *parse_stream(char **pstring,
nommu_addchr(&ctx.as_string, ch);
if (ch == '\'')
break;
+ if (ch == SPECIAL_VAR_SYMBOL) {
+ /* Convert raw ^C to corresponding special variable reference */
+ o_addchr(&dest, SPECIAL_VAR_SYMBOL);
+ o_addchr(&dest, SPECIAL_VAR_QUOTED_SVS);
+ }
o_addqchr(&dest, ch);
}
}