From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15271 invoked by alias); 6 Jan 2013 19:18:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30950 Received: (qmail 3914 invoked from network); 6 Jan 2013 19:18:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.49 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-proxyuser-ip:date:from:to:subject:message-id :in-reply-to:references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=8SVhvUXUnsKRFpyrGaxuizkubumrF9zBBCCav6eAUTw=; b=UeoERVmL0e/w3zVgplhO7uuEJquySOl3UcGDU27cj4UwvEi0+Spqf0BnBpKPgtjUd8 traWlHANY7TcD8CLzCjQYHH/vkrQKkA9jhVnqHm3WGQzPyi2D65cThNApxoRNprFURLN mVKixZbL1E+IjsvOuPKrkovlW7ux2BACc94PEh3ZtqjuJrJUOe9VnhUwCcoawZJldQTs JEFXUNJvkeT+APsXwcXGQJm9ssEIA9OvV5cydILttOyoxwz4UJ6U7ULsdl5sJ6gMw0Zm osLsb0WIWlFPe5mj8YhsU2VcueiJpzCiejNXxwtiOwQs7mn2YO6fQ6dy3A/rPyhaYmWX gNIA== X-Received: by 10.180.39.143 with SMTP id p15mr5803436wik.14.1357498066065; Sun, 06 Jan 2013 10:47:46 -0800 (PST) X-ProxyUser-IP: 86.26.6.143 Date: Sun, 6 Jan 2013 18:47:43 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: read -q broken on OSX / BSD? Message-ID: <20130106184743.6325554b@pws-pc.ntlworld.com> In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQketxVF7JeeecfIYXHZkawndln018f6X8vbL+H2T0S8gvgnQSK8/ypeMbFkTebWxXA6p7JG On Sun, 6 Jan 2013 11:06:05 +0200 Yaniv Aknin wrote: > I'm running % read -q, and then typing a single character which isn't y, Y > or n. However, the value set in $REPLY isn't n, it is the character I > typed. The documentation for read -q explicitly says I should expect > 'n' if the typed character wasn't 'y' or 'Y'. That does seem to have gone missing. Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.268 diff -p -u -r1.268 builtin.c --- Src/builtin.c 8 Nov 2012 16:50:42 -0000 1.268 +++ Src/builtin.c 6 Jan 2013 18:46:21 -0000 @@ -5490,6 +5490,12 @@ bin_read(char *name, char **args, Option eof = 2; else eof = (bptr - buf != 1 || (buf[0] != 'y' && buf[0] != 'Y')); + if (eof) { + *buf = 'n'; + } else { + *buf = 'y'; + } + bptr = buf + 1; } if (OPT_ISSET(ops,'e') || OPT_ISSET(ops,'E')) fwrite(buf, bptr - buf, 1, stdout); -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/