summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/zle_main.c23
2 files changed, 20 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 4b5ac3b5b..d592ef5cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-11 Peter Stephenson <pws@csr.com>
+
+ * 26025: Src/Zle/zle_main.c: prefer handling user input to
+ file installed with zle -F.
+
2008-11-11 Clint Adams <clint@zsh.org>
* 26023: Completion/Unix/Command/_topgit: skeletal completion for
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 093160808..76bf44cbd 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -585,7 +585,7 @@ raw_getbyte(long do_keytmout, char *cptr)
fds[i+1].events = POLLIN;
}
# endif
- do {
+ for (;;) {
# ifdef HAVE_POLL
int poll_timeout;
@@ -694,6 +694,19 @@ raw_getbyte(long do_keytmout, char *cptr)
/* If error or unhandled timeout, give up. */
if (selret < 0)
break;
+ /*
+ * If there's user input handle it straight away.
+ * This improves the user's ability to handle exceptional
+ * conditions like runaway output.
+ */
+ if (
+# ifdef HAVE_POLL
+ (fds[0].revents & POLLIN)
+# else
+ FD_ISSET(SHTTY, &foofd)
+# endif
+ )
+ break;
if (nwatch && !errtry) {
/*
* Copy the details of the watch fds in case the
@@ -755,13 +768,7 @@ raw_getbyte(long do_keytmout, char *cptr)
zfree(lwatch_fds, lnwatch*sizeof(int));
freearray(lwatch_funcs);
}
- } while (!
-# ifdef HAVE_POLL
- (fds[0].revents & POLLIN)
-# else
- FD_ISSET(SHTTY, &foofd)
-# endif
- );
+ }
# ifdef HAVE_POLL
zfree(fds, sizeof(struct pollfd) * nfds);
# endif