summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 2cebfe2..e0828d4 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -11592,11 +11592,17 @@ checkend: {
if (c == *eofmark) {
if (pfgets(line, sizeof(line)) != NULL) {
char *p, *q;
+ int cc;
p = line;
- for (q = eofmark + 1; *q && *p == *q; p++, q++)
- continue;
- if (*p == '\n' && *q == '\0') {
+ for (q = eofmark + 1;; p++, q++) {
+ cc = *p;
+ if (cc == '\n')
+ cc = 0;
+ if (!*q || cc != *q)
+ break;
+ }
+ if (cc == *q) {
c = PEOF;
nlnoprompt();
} else {