summary refs log tree commit diff
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
parentUpdate funcnest atomically. (diff)
downloaddash-add99dd37b51b1585dc6ac8f65d592b9ddcf932b.tar.gz
dash-add99dd37b51b1585dc6ac8f65d592b9ddcf932b.zip
Only set skipcount for break and continue.
Diffstat (limited to '')
-rw-r--r--ChangeLog1
-rw-r--r--src/eval.c23
2 files changed, 8 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 35bcdda..13fc33f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 	* Replaced EXEVAL with SKIPEVAL.
 	* Update funcnest atomically.
+	* Only set skipcount for break and continue.
 
 2005-02-28  A Costa <agcosta@gis.net>
 
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;
 }
 
 
Use LDADD variables, support BINDIRJune McEnroe Also change MANDIR default to ${PREFIX}/man. 2020-12-13Use nick for color if user is "*" 1.1June McEnroe Not accurate but better than all nicks being the same color in imported logs. 2020-08-23Use DESTDIR in install 1.0June McEnroe 2020-08-23Add catsit example to READMEJune McEnroe 2020-08-23Update litterbox version rangeJune McEnroe 2020-08-19Set a database busy timeoutJune McEnroe 2020-07-29Add Linux supportJune McEnroe Static linking on Linux (even with musl-gcc) is just too much of a pain. People more dedicated than I am can figure it out themselves. Or how to properly sandbox this without a chroot. 2020-07-29Remove unused prevEventJune McEnroe 2020-07-23Rewrite configure scriptJune McEnroe 2020-07-21Add OpenBSD instructionsJune McEnroe 2020-07-21Use a .pc file to configureJune McEnroe 2020-07-19Filter networks with only private contexts from recents as wellJune McEnroe 2020-07-18Specify litterbox version in readmeJune McEnroe 2020-07-18Reverse order of X macro parameters for pages and keysJune McEnroe 2020-07-18Remove kcgi 0.11 compatibilityJune McEnroe 2020-07-17Filter networks with only private contextsJune McEnroe 2020-07-17Add export optionJune McEnroe Adding the export query parameter to any page downloads a .html with the default stylesheet embedded, and all navigation, forms and internal links removed, for being able to share some part of a private instance of litterbox. 2020-07-17Add margin to inputsJune McEnroe Seems that only Safari provides any margins on form elements by default. 2020-07-16Don't write null terminator in stylesheet responseJune McEnroe 2020-07-16Remove sudo from make installJune McEnroe