diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-06-27 05:33:04 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-06-27 05:33:04 +0000 |
commit | 346825df86466cf151be61b9429ef2c1734e66ea (patch) | |
tree | bd3e1ccd947b47f974c62b4113c5276416de2c9f /Src/input.c | |
parent | a2159285e80508bb682d90a71270fbddada8bd05 (diff) | |
download | zsh-346825df86466cf151be61b9429ef2c1734e66ea.tar.gz zsh-346825df86466cf151be61b9429ef2c1734e66ea.tar.xz zsh-346825df86466cf151be61b9429ef2c1734e66ea.zip |
zsh-3.1.5-pws-24 zsh-3.1.5-pws-24
Diffstat (limited to 'Src/input.c')
-rw-r--r-- | Src/input.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/Src/input.c b/Src/input.c index b4a6fe22d..d05c75c0b 100644 --- a/Src/input.c +++ b/Src/input.c @@ -186,6 +186,8 @@ ingetc(void) inbufct--; if (itok(lastc = STOUC(*inbufptr++))) continue; + if (((inbufflags & INP_LINENO) || !strin) && lastc == '\n') + lineno++; return lastc; } @@ -279,23 +281,20 @@ inputline(void) zputs(ingetcline, stderr); fflush(stderr); } - if (*ingetcline && ingetcline[strlen(ingetcline) - 1] == '\n') { - /* We've now read a complete line. */ - lineno++; - if (interact && isset(SUNKEYBOARDHACK) && isset(SHINSTDIN) && - SHTTY != -1 && *ingetcline && ingetcline[1] && - ingetcline[strlen(ingetcline) - 2] == '`') { - /* Junk an unmatched "`" at the end of the line. */ - int ct; - char *ptr; - - for (ct = 0, ptr = ingetcline; *ptr; ptr++) - if (*ptr == '`') - ct++; - if (ct & 1) { - ptr[-2] = '\n'; - ptr[-1] = '\0'; - } + if (*ingetcline && ingetcline[strlen(ingetcline) - 1] == '\n' && + interact && isset(SUNKEYBOARDHACK) && isset(SHINSTDIN) && + SHTTY != -1 && *ingetcline && ingetcline[1] && + ingetcline[strlen(ingetcline) - 2] == '`') { + /* Junk an unmatched "`" at the end of the line. */ + int ct; + char *ptr; + + for (ct = 0, ptr = ingetcline; *ptr; ptr++) + if (*ptr == '`') + ct++; + if (ct & 1) { + ptr[-2] = '\n'; + ptr[-1] = '\0'; } } isfirstch = 1; @@ -359,6 +358,8 @@ inungetc(int c) inbufptr--; inbufct++; inbufleft++; + if (((inbufflags & INP_LINENO) || !strin) && c == '\n') + lineno--; } #ifdef DEBUG else if (!(inbufflags & INP_CONT)) { |