about summary refs log tree commit diff
path: root/Src/hist.c
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2000-10-21 03:15:36 +0000
committerBart Schaefer <barts@users.sourceforge.net>2000-10-21 03:15:36 +0000
commit9bf7fb75c55d3ac23c47d5af0d96f4e1af727222 (patch)
treea2cec68677fa6ff7f7acb313c20aa2ccdc4d6ad8 /Src/hist.c
parente14a02f4408039ce7aa46ea085a7cf9156e648d0 (diff)
downloadzsh-9bf7fb75c55d3ac23c47d5af0d96f4e1af727222.tar.gz
zsh-9bf7fb75c55d3ac23c47d5af0d96f4e1af727222.tar.xz
zsh-9bf7fb75c55d3ac23c47d5af0d96f4e1af727222.zip
Fix "vared -h" in shell scripts.
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 4d803c0bd..9149d479b 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -736,7 +736,12 @@ hbegin(int dohist)
 {
     isfirstln = isfirstch = 1;
     errflag = histdone = 0;
-    stophist = (!dohist || !interact || unset(SHINSTDIN)) ? 2 : 0;
+    if (!dohist)
+	stophist = 2;
+    else if (dohist != 2)
+	stophist = (!interact || unset(SHINSTDIN)) ? 2 : 0;
+    else
+	stophist = 0;
     if (stophist == 2 || (inbufflags & INP_ALIAS)) {
 	chline = hptr = NULL;
 	hlinesz = 0;
@@ -764,7 +769,7 @@ hbegin(int dohist)
 
     if (hist_ring && !hist_ring->ftim)
 	hist_ring->ftim = time(NULL);
-    if (interact && isset(SHINSTDIN) && !strin) {
+    if ((dohist == 2 || (interact && isset(SHINSTDIN))) && !strin) {
 	histactive = HA_ACTIVE;
 	attachtty(mypgrp);
 	linkcurline();