summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorherbert <herbert@gondor.apana.org.au>2005-02-28 21:32:52 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:33:04 +1000
commitadd99dd37b51b1585dc6ac8f65d592b9ddcf932b (patch)
tree48d3a962d6987a04078d995761578e57b04ce296 /src
parentUpdate funcnest atomically. (diff)
downloaddash-add99dd37b51b1585dc6ac8f65d592b9ddcf932b.tar.gz
dash-add99dd37b51b1585dc6ac8f65d592b9ddcf932b.zip
Only set skipcount for break and continue.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/eval.c b/src/eval.c
index e833882..30c9c2a 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -974,10 +974,8 @@ funcdone:
 	shellparam = saveparam;
 	handler = savehandler;
 	INTON;
-	if (evalskip == SKIPFUNC) {
+	if (evalskip == SKIPFUNC)
 		evalskip = 0;
-		skipcount = 0;
-	}
 	return e;
 }
 
@@ -1057,19 +1055,12 @@ breakcmd(int argc, char **argv)
 int
 returncmd(int argc, char **argv)
 {
-	int ret = argc > 1 ? number(argv[1]) : exitstatus;
-
-	if (funcnest) {
-		evalskip = SKIPFUNC;
-		skipcount = 1;
-		return ret;
-	}
-	else {
-		/* Do what ksh does; skip the rest of the file */
-		evalskip = SKIPFILE;
-		skipcount = 1;
-		return ret;
-	}
+	/*
+	 * If called outside a function, do what ksh does;
+	 * skip the rest of the file.
+	 */
+	evalskip = funcnest ? SKIPFUNC : SKIPFILE;
+	return argv[1] ? number(argv[1]) : exitstatus;
 }
 
 
pan>Factor out common parts of downgrade messagesJune McEnroe 2021-09-14Add downgrade IRC botJune McEnroe 2021-09-14Sort by title if authors matchJune McEnroe 2021-09-13Swap-remove tags as they're foundJune McEnroe 2021-09-12Replace htagml regex with strncmpJune McEnroe 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe