diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/parser.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c index cc1860d..192769b 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -1513,10 +1513,12 @@ checkend: { p = line; for (q = eofmark + 1 ; *q && *p == *q ; p++, q++); - if (*p == '\n' && *q == '\0') { + if ((*p == '\0' || *p == '\n') && *q == '\0') { c = PEOF; - plinno++; - needprompt = doprompt; + if (*p == '\n') { + plinno++; + needprompt = doprompt; + } } else { pushstring(line, strlen(line), NULL); } |