[git commit master] ash: fix ". empty_file" exitcode. +5 bytes

Denys Vlasenko vda.linux at googlemail.com
Mon May 17 15:10:46 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=cd10dc40e4057d081caf7676a4fed31977f2d94d
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c                           |    8 +++++---
 shell/ash_test/ash-misc/source2.tests |    1 -
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/shell/ash.c b/shell/ash.c
index 75bfbf1..ef5b2d4 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12031,13 +12031,16 @@ dotcmd(int argc, char **argv)
 {
 	struct strlist *sp;
 	volatile struct shparam saveparam;
-	int status = 0;
 
 	for (sp = cmdenviron; sp; sp = sp->next)
 		setvareq(ckstrdup(sp->text), VSTRFIXED | VTEXTFIXED);
 
+	/* "false; . empty_file; echo $?" should print 0, not 1: */
+	exitstatus = 0;
+
 	if (argv[1]) {        /* That's what SVR2 does */
 		char *fullname = find_dot_file(argv[1]);
+
 		argv += 2;
 		argc -= 2;
 		if (argc) { /* argc > 0, argv[0] != NULL */
@@ -12056,9 +12059,8 @@ dotcmd(int argc, char **argv)
 			freeparam(&shellparam);
 			shellparam = saveparam;
 		};
-		status = exitstatus;
 	}
-	return status;
+	return exitstatus;
 }
 
 static int FAST_FUNC
diff --git a/shell/ash_test/ash-misc/source2.tests b/shell/ash_test/ash-misc/source2.tests
index ab63247..1870cdf 100755
--- a/shell/ash_test/ash-misc/source2.tests
+++ b/shell/ash_test/ash-misc/source2.tests
@@ -1,4 +1,3 @@
-# Not fixed yet
 false
 . /dev/null
 echo Done: $?
-- 
1.6.3.3



More information about the busybox-cvs mailing list