about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2013-01-06 18:55:00 +0000
committerBart Schaefer <barts@users.sourceforge.net>2013-01-06 18:55:00 +0000
commitdda51b9dbbfa6b3f7b8b99124b0a2a504521eb2c (patch)
tree944d782600d2cfe64ac7e2716fe3ca2525fd99ad
parenta67802ba824ca3a7d27cbb54a5d3bcd13c14677a (diff)
downloadzsh-dda51b9dbbfa6b3f7b8b99124b0a2a504521eb2c.tar.gz
zsh-dda51b9dbbfa6b3f7b8b99124b0a2a504521eb2c.tar.xz
zsh-dda51b9dbbfa6b3f7b8b99124b0a2a504521eb2c.zip
30949: restore "read -q" behavior lost by 27188
-rw-r--r--ChangeLog6
-rw-r--r--Src/builtin.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ff889885..14ff3458b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-01-06  Bart Schaefer  <schaefer@zsh.org>
+
+	* 30949: Src/builtin.c: restore "read -q" behavior lost by 27188.
+
 2013-01-05  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 30946: Robert Kovacsics: Completion/X/Command/_xrandr: use
@@ -431,5 +435,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5782 $
+* $Revision: 1.5783 $
 *****************************************************
diff --git a/Src/builtin.c b/Src/builtin.c
index 90fe1a6c5..f5c727f47 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5490,6 +5490,9 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func))
 		eof = 2;
 	    else
 		eof = (bptr - buf != 1 || (buf[0] != 'y' && buf[0] != 'Y'));
+	    buf[0] = eof ? 'n' : 'y';
+	    buf[1] = 0;
+	    bptr = buf+2;
 	}
 	if (OPT_ISSET(ops,'e') || OPT_ISSET(ops,'E'))
 	    fwrite(buf, bptr - buf, 1, stdout);