diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-08-22 01:55:58 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-08-22 01:55:58 +0200 |
commit | 02f6e25bfcd5feb9a093377dda0dd549cdf5c309 (patch) | |
tree | 9a25e61122b3fa0d0a1ff68b5ef05c775ff78b1e /Src/input.c | |
parent | e04a19735ffc8523b93b33074f685ad4e2c92e0c (diff) | |
parent | 881474edcb223ac22a08d81a824809c33ca3a9c9 (diff) | |
download | zsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.tar.gz zsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.zip |
Merge tag 'zsh-5.0.8-test-2' into debian
Diffstat (limited to 'Src/input.c')
-rw-r--r-- | Src/input.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Src/input.c b/Src/input.c index 4a5bf89c6..eb968ea72 100644 --- a/Src/input.c +++ b/Src/input.c @@ -141,16 +141,19 @@ shingetline(void) int c; char buf[BUFSIZ]; char *p; + int q = queue_signal_level(); p = buf; - winch_unblock(); for (;;) { + winch_unblock(); + dont_queue_signals(); do { errno = 0; c = fgetc(bshin); } while (c < 0 && errno == EINTR); if (c < 0 || c == '\n') { winch_block(); + restore_queue_signals(q); if (c == '\n') *p++ = '\n'; if (p > buf) { @@ -167,12 +170,13 @@ shingetline(void) *p++ = c; if (p >= buf + BUFSIZ - 1) { winch_block(); + queue_signals(); line = zrealloc(line, ll + (p - buf) + 1); memcpy(line + ll, buf, p - buf); ll += p - buf; line[ll] = '\0'; p = buf; - winch_unblock(); + unqueue_signals(); } } } @@ -222,7 +226,8 @@ ingetc(void) if (inputline()) break; } - zshlex_raw_add(lastc); + if (!lexstop) + zshlex_raw_add(lastc); return lastc; } @@ -376,6 +381,8 @@ inputline(void) static void inputsetline(char *str, int flags) { + queue_signals(); + if ((inbufflags & INP_FREE) && inbuf) { free(inbuf); } @@ -393,6 +400,8 @@ inputsetline(char *str, int flags) else inbufct = inbufleft; inbufflags = flags; + + unqueue_signals(); } /* @@ -591,7 +600,7 @@ inpoptop(void) * history is before, but they're both pushed onto * the input stack. */ - if ((inbufflags & (INP_ALIAS|INP_HIST)) == INP_ALIAS) + if ((inbufflags & (INP_ALIAS|INP_HIST|INP_RAW_KEEP)) == INP_ALIAS) zshlex_raw_back(); } } |