aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-17 17:10:46 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-17 17:10:46 +0200
commitcd10dc40e4057d081caf7676a4fed31977f2d94d (patch)
tree6f6de28aa7a182b1fb0fba9a607131d32a12d909 /shell
parentbbf1aa1eaf6278e23ae75914c8d9b9be4d0e28f5 (diff)
downloadbusybox-w32-cd10dc40e4057d081caf7676a4fed31977f2d94d.tar.gz
busybox-w32-cd10dc40e4057d081caf7676a4fed31977f2d94d.tar.bz2
busybox-w32-cd10dc40e4057d081caf7676a4fed31977f2d94d.zip
ash: fix ". empty_file" exitcode. +5 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c8
-rwxr-xr-xshell/ash_test/ash-misc/source2.tests1
2 files changed, 5 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 75bfbf115..ef5b2d4c1 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12031,13 +12031,16 @@ dotcmd(int argc, char **argv)
12031{ 12031{
12032 struct strlist *sp; 12032 struct strlist *sp;
12033 volatile struct shparam saveparam; 12033 volatile struct shparam saveparam;
12034 int status = 0;
12035 12034
12036 for (sp = cmdenviron; sp; sp = sp->next) 12035 for (sp = cmdenviron; sp; sp = sp->next)
12037 setvareq(ckstrdup(sp->text), VSTRFIXED | VTEXTFIXED); 12036 setvareq(ckstrdup(sp->text), VSTRFIXED | VTEXTFIXED);
12038 12037
12038 /* "false; . empty_file; echo $?" should print 0, not 1: */
12039 exitstatus = 0;
12040
12039 if (argv[1]) { /* That's what SVR2 does */ 12041 if (argv[1]) { /* That's what SVR2 does */
12040 char *fullname = find_dot_file(argv[1]); 12042 char *fullname = find_dot_file(argv[1]);
12043
12041 argv += 2; 12044 argv += 2;
12042 argc -= 2; 12045 argc -= 2;
12043 if (argc) { /* argc > 0, argv[0] != NULL */ 12046 if (argc) { /* argc > 0, argv[0] != NULL */
@@ -12056,9 +12059,8 @@ dotcmd(int argc, char **argv)
12056 freeparam(&shellparam); 12059 freeparam(&shellparam);
12057 shellparam = saveparam; 12060 shellparam = saveparam;
12058 }; 12061 };
12059 status = exitstatus;
12060 } 12062 }
12061 return status; 12063 return exitstatus;
12062} 12064}
12063 12065
12064static int FAST_FUNC 12066static int FAST_FUNC
diff --git a/shell/ash_test/ash-misc/source2.tests b/shell/ash_test/ash-misc/source2.tests
index ab63247ef..1870cdf7e 100755
--- a/shell/ash_test/ash-misc/source2.tests
+++ b/shell/ash_test/ash-misc/source2.tests
@@ -1,4 +1,3 @@
1# Not fixed yet
2false 1false
3. /dev/null 2. /dev/null
4echo Done: $? 3echo Done: $?