about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-09-17 10:46:30 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-09-17 10:46:30 +0000
commit2421fe859969171914aac4e9280b96db1b173763 (patch)
treefafce9cb7597057a23f6e5aafe2904adb4df6b67 /Src/exec.c
parent695f023058a9c37d70e057dcf4ad9c7dfedfca9f (diff)
downloadzsh-2421fe859969171914aac4e9280b96db1b173763.tar.gz
zsh-2421fe859969171914aac4e9280b96db1b173763.tar.xz
zsh-2421fe859969171914aac4e9280b96db1b173763.zip
17673: Fix bug with &&s and ||s in complex constructs
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index f1206e93c..4ed4f0671 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -848,8 +848,15 @@ execlist(Estate state, int dont_change_job, int exiting)
 			 * for this sublist.                                   */
 			donetrap = 1;
 			goto sublist_done;
-		    } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END)
+		    } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END) {
 			donetrap = 1;
+			/*
+			 * Treat this in the same way as if we reached
+			 * the end of the sublist normally.
+			 */
+			state->pc = next;
+			goto sublist_done;
+		    }
 		}
 		cmdpush(CS_CMDAND);
 		break;
@@ -874,8 +881,15 @@ execlist(Estate state, int dont_change_job, int exiting)
 			 * for this sublist.                                   */
 			donetrap = 1;
 			goto sublist_done;
-		    } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END)
+		    } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END) {
 			donetrap = 1;
+			/*
+			 * Treat this in the same way as if we reached
+			 * the end of the sublist normally.
+			 */
+			state->pc = next;
+			goto sublist_done;
+		    }
 		}
 		cmdpush(CS_CMDOR);
 		break;