From dda51b9dbbfa6b3f7b8b99124b0a2a504521eb2c Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sun, 6 Jan 2013 18:55:00 +0000 Subject: 30949: restore "read -q" behavior lost by 27188 --- Src/builtin.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Src/builtin.c') 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); -- cgit 1.4.1