summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko2018-04-10 14:49:01 +0200
committerDenys Vlasenko2018-04-10 14:49:01 +0200
commit4709df0f152c477c191f83e18bfecabb2fb2c1f9 (patch)
treefa94cad09f55f5a46c8bb793637278b62f2a4b6d /shell/hush.c
parentbcf56114fa7f037cea579cdc8d17ac1a5dab93a3 (diff)
downloadbusybox-4709df0f152c477c191f83e18bfecabb2fb2c1f9.zip
busybox-4709df0f152c477c191f83e18bfecabb2fb2c1f9.tar.gz
hush: fix handling of \<eof> in double-quoted strings
function old new delta encode_string 268 250 -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 5df8d47..98ba96e 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4913,11 +4913,12 @@ static int encode_string(o_string *as_string,
ch, ch, !!(dest->o_expflags & EXP_FLAG_ESC_GLOB_CHARS));
if (process_bkslash && ch == '\\') {
if (next == EOF) {
-// TODO: what if in interactive shell a file with
-// echo "unterminated string\<eof>
-// is sourced?
- syntax_error("\\<eof>");
- xfunc_die();
+ /* Testcase: in interactive shell a file with
+ * echo "unterminated string\<eof>
+ * is sourced.
+ */
+ syntax_error_unterm_ch('"');
+ return 0; /* error */
}
/* bash:
* "The backslash retains its special meaning [in "..."]