diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2011-04-11 16:34:21 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2011-04-11 16:34:21 +0000 |
commit | 35ddd9c4bae1956932dc45b4af48391ac71da0a2 (patch) | |
tree | 2097a461616752935f21544223a6277ce8e0fcb9 | |
parent | f2ea8831e16a0238908ec116c93df3676e52ae4f (diff) | |
download | zsh-35ddd9c4bae1956932dc45b4af48391ac71da0a2.tar.gz zsh-35ddd9c4bae1956932dc45b4af48391ac71da0a2.tar.xz zsh-35ddd9c4bae1956932dc45b4af48391ac71da0a2.zip |
users/15953: handle EINTR when using read -k or -q with -u or -p
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | Src/builtin.c | 13 |
2 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog index e8c439bd3..cf1bfc19b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-04-11 Peter Stephenson <pws@csr.com> + + * users/15953: Src/builtin.c: handle EINTR when using read -k or + -q together with -u or -p. + + * cat.in.136: users/15945: Completion/Redhat/Command/_yum: + various corrections and updates. + 2011-04-05 Wayne Davison <wayned@users.sourceforge.net> * 28977: Src/utils.c: fix copying of uninitialized memory @@ -14425,5 +14433,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5241 $ +* $Revision: 1.5242 $ ***************************************************** diff --git a/Src/builtin.c b/Src/builtin.c index cda5e68cb..127d58bdb 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5291,9 +5291,16 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func)) *bptr = readchar; val = 1; readchar = -1; - } else if ((val = read(readfd, bptr, nchars)) <= 0) { - eof = 1; - break; + } else { + while ((val = read(readfd, bptr, nchars)) < 0) { + if (errno != EINTR || + errflag || retflag || breaks || contflag) + break; + } + if (val <= 0) { + eof = 1; + break; + } } #ifdef MULTIBYTE_SUPPORT |