summary refs log tree commit diff
diff options
context:
space:
mode:
authorherbert <herbert@gondor.apana.org.au>2005-03-03 22:05:03 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:33:04 +1000
commit6c38af156c1ff6cd4928fbd526bc0bee042a29fb (patch)
tree8e32e10ed2f6dbf93a1254dd651aec8a2aab9d9d
parentRemoved redundant setstackmark from dotcmd. (diff)
downloaddash-6c38af156c1ff6cd4928fbd526bc0bee042a29fb.tar.gz
dash-6c38af156c1ff6cd4928fbd526bc0bee042a29fb.zip
Do not clobber exit status in dotcmd.
-rw-r--r--ChangeLog1
-rw-r--r--src/main.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 350006c..52fdb74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 	* Removed qflag.
 	* Removed redundant setstackmark from dotcmd.
+	* Do not clobber exit status in dotcmd.
 
 2005-03-02  Herbert Xu <herbert@gondor.apana.org.au>
 
diff --git a/src/main.c b/src/main.c
index 31d559d..b6dea21 100644
--- a/src/main.c
+++ b/src/main.c
@@ -341,7 +341,7 @@ find_dot_file(char *basename)
 int
 dotcmd(int argc, char **argv)
 {
-	exitstatus = 0;
+	int status = 0;
 
 	if (argc >= 2) {		/* That's what SVR2 does */
 		char *fullname;
@@ -351,8 +351,9 @@ dotcmd(int argc, char **argv)
 		commandname = fullname;
 		cmdloop(0);
 		popfile();
+		status = exitstatus;
 	}
-	return exitstatus;
+	return status;
 }