summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r--bin/sh/parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index e19a04e..3f3103a 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -1401,6 +1401,8 @@ parsesub: {
subtype = VSERROR;
if (c == '}')
pungetc();
+ else if (c == '\n' || c == PEOF)
+ synerror("Unexpected end of line in substitution");
else
USTPUTC(c, out);
} else {
@@ -1417,6 +1419,8 @@ parsesub: {
default:
p = strchr(types, c);
if (p == NULL) {
+ if (c == '\n' || c == PEOF)
+ synerror("Unexpected end of line in substitution");
if (flags == VSNUL)
STPUTC(':', out);
STPUTC(c, out);
OpenPOWER on IntegriCloud