about summary refs log tree commit diff
path: root/Src/loop.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-11 22:04:24 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-11 22:04:24 +0000
commitbfd6782b5a7a75568be3554bbdc7d7eee53e6538 (patch)
tree75fb9fce21e3897156eed95bb68428a659c711ad /Src/loop.c
parenta978d1c47cc8fab586b26b74a3abadbee0da3439 (diff)
downloadzsh-bfd6782b5a7a75568be3554bbdc7d7eee53e6538.tar.gz
zsh-bfd6782b5a7a75568be3554bbdc7d7eee53e6538.tar.xz
zsh-bfd6782b5a7a75568be3554bbdc7d7eee53e6538.zip
zsh-workers/9295
Diffstat (limited to 'Src/loop.c')
-rw-r--r--Src/loop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/loop.c b/Src/loop.c
index 0d7379c00..b8e7f956f 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -154,7 +154,7 @@ execselect(Cmd cmd, LinkList args, int flags)
     Forcmd node;
     char *str, *s;
     LinkNode n;
-    int i;
+    int i, usezle;
     FILE *inp;
     size_t more;
 
@@ -172,12 +172,13 @@ execselect(Cmd cmd, LinkList args, int flags)
     lastval = 0;
     pushheap();
     cmdpush(CS_SELECT);
-    inp = fdopen(dup((SHTTY == -1) ? 0 : SHTTY), "r");
+    usezle = interact && SHTTY != -1 && isset(USEZLE);
+    inp = fdopen(dup(usezle ? SHTTY : 0), "r");
     more = selectlist(args, 0);
     for (;;) {
 	for (;;) {
 	    if (empty(bufstack)) {
-	    	if (interact && SHTTY != -1 && isset(USEZLE)) {
+	    	if (usezle) {
 		    int oef = errflag;
 
 		    isfirstln = 1;