Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug in read builtin and Re: PATCH: extra loop tests
- X-seq: zsh-workers 18392
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: bug in read builtin and Re: PATCH: extra loop tests
- Date: Wed, 26 Mar 2003 17:52:05 +0000
- In-reply-to: "Oliver Kiddle"'s message of "Wed, 26 Mar 2003 18:24:39 +0100." <2861.1048699479@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Oliver Kiddle wrote:
> In adding tests for read (to cover the
> new read -d), I found that read -t 1 -p causes a seg fault:
I think this test needs to be in other places, but the logic in
bin_read() is a bit tortuous.
Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.97
diff -u -r1.97 builtin.c
--- Src/builtin.c 17 Feb 2003 10:08:03 -0000 1.97
+++ Src/builtin.c 26 Mar 2003 17:50:28 -0000
@@ -4212,7 +4212,8 @@
timeout = (zlong)mn.u.l * (zlong)1000000;
}
}
- if (!read_poll(readfd, &readchar, keys && !zleactive, timeout)) {
+ if (readfd == -1 ||
+ !read_poll(readfd, &readchar, keys && !zleactive, timeout)) {
if (OPT_ISSET(ops,'k') && !zleactive && !isem)
settyinfo(&shttyinfo);
if (haso) {
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author