about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-09-15 16:29:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-09-15 16:29:00 +0000
commite16ceeaedd085ccc966196f82aa210ac117c40ef (patch)
tree60da0d05bde076ccd69f0790a5a46b304f6d5d75
parent23f7b121bf91701c953005ca090ff40d8510b6c8 (diff)
downloadzsh-e16ceeaedd085ccc966196f82aa210ac117c40ef.tar.gz
zsh-e16ceeaedd085ccc966196f82aa210ac117c40ef.tar.xz
zsh-e16ceeaedd085ccc966196f82aa210ac117c40ef.zip
22715: AUTOCONTINUE option never worked.
-rw-r--r--ChangeLog4
-rw-r--r--Src/exec.c24
2 files changed, 20 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 207a7ee15..64b3bc600 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-09-15  Peter Stephenson  <pws@csr.com>
+
+	* 22715: Src/exec.c: AUTOCONTINUE option never worked.
+
 2006-08-22  Peter Stephenson  <pws@csr.com>
 
 	* 22656: Src/options.c (slightly tweaked): improve handling of
diff --git a/Src/exec.c b/Src/exec.c
index b8583923f..d34de945a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1753,7 +1753,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
     int nullexec = 0, assign = 0, forked = 0;
     int is_shfunc = 0, is_builtin = 0, is_exec = 0, use_defpath = 0;
     /* Various flags to the command. */
-    int cflags = 0, checked = 0, oautocont = opts[AUTOCONTINUE];
+    int cflags = 0, checked = 0, oautocont = -1;
     LinkList redir;
     wordcode code;
     Wordcode beg = state->pc, varspc;
@@ -1788,8 +1788,10 @@ execcmd(Estate state, int input, int output, int how, int last1)
      * reference to a job in the job table.                */
     if (type == WC_SIMPLE && args && nonempty(args) &&
 	*(char *)peekfirst(args) == '%') {
-        if (how & Z_DISOWN)
+        if (how & Z_DISOWN) {
+	    oautocont = opts[AUTOCONTINUE];
             opts[AUTOCONTINUE] = 1;
+	}
 	pushnode(args, dupstring((how & Z_DISOWN)
 				 ? "disown" : (how & Z_ASYNC) ? "bg" : "fg"));
 	how = Z_SYNC;
@@ -1975,7 +1977,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 		if (cflags & BINF_BUILTIN) {
 		    zwarn("no such builtin: %s", cmdarg, 0);
 		    lastval = 1;
-                    opts[AUTOCONTINUE] = oautocont;
+		    if (oautocont >= 0)
+			opts[AUTOCONTINUE] = oautocont;
 		    return;
 		}
 		break;
@@ -1999,7 +2002,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 
     if (errflag) {
 	lastval = 1;
-        opts[AUTOCONTINUE] = oautocont;
+	if (oautocont >= 0)
+	    opts[AUTOCONTINUE] = oautocont;
 	return;
     }
 
@@ -2043,7 +2047,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 
     if (errflag) {
 	lastval = 1;
-        opts[AUTOCONTINUE] = oautocont;
+	if (oautocont >= 0)
+	    opts[AUTOCONTINUE] = oautocont;
 	return;
     }
 
@@ -2127,7 +2132,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 	if ((pid = zfork(&bgtime)) == -1) {
 	    close(synch[0]);
 	    close(synch[1]);
-            opts[AUTOCONTINUE] = oautocont;
+	    if (oautocont >= 0)
+		opts[AUTOCONTINUE] = oautocont;
 	    return;
 	} if (pid) {
 	    close(synch[1]);
@@ -2153,7 +2159,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 		}
 	    }
 	    addproc(pid, text, 0, &bgtime);
-            opts[AUTOCONTINUE] = oautocont;
+	    if (oautocont >= 0)
+		opts[AUTOCONTINUE] = oautocont;
 	    return;
 	}
 	/* pid == 0 */
@@ -2526,7 +2533,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 
     zsfree(STTYval);
     STTYval = 0;
-    opts[AUTOCONTINUE] = oautocont;
+    if (oautocont >= 0)
+	opts[AUTOCONTINUE] = oautocont;
 }
 
 /* Arrange to have variables restored. */