mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
ash: fix ". empty_file" exitcode. +5 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
bbf1aa1eaf
commit
cd10dc40e4
@ -12031,13 +12031,16 @@ dotcmd(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
struct strlist *sp;
|
struct strlist *sp;
|
||||||
volatile struct shparam saveparam;
|
volatile struct shparam saveparam;
|
||||||
int status = 0;
|
|
||||||
|
|
||||||
for (sp = cmdenviron; sp; sp = sp->next)
|
for (sp = cmdenviron; sp; sp = sp->next)
|
||||||
setvareq(ckstrdup(sp->text), VSTRFIXED | VTEXTFIXED);
|
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 */
|
if (argv[1]) { /* That's what SVR2 does */
|
||||||
char *fullname = find_dot_file(argv[1]);
|
char *fullname = find_dot_file(argv[1]);
|
||||||
|
|
||||||
argv += 2;
|
argv += 2;
|
||||||
argc -= 2;
|
argc -= 2;
|
||||||
if (argc) { /* argc > 0, argv[0] != NULL */
|
if (argc) { /* argc > 0, argv[0] != NULL */
|
||||||
@ -12056,9 +12059,8 @@ dotcmd(int argc, char **argv)
|
|||||||
freeparam(&shellparam);
|
freeparam(&shellparam);
|
||||||
shellparam = saveparam;
|
shellparam = saveparam;
|
||||||
};
|
};
|
||||||
status = exitstatus;
|
|
||||||
}
|
}
|
||||||
return status;
|
return exitstatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FAST_FUNC
|
static int FAST_FUNC
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# Not fixed yet
|
|
||||||
false
|
false
|
||||||
. /dev/null
|
. /dev/null
|
||||||
echo Done: $?
|
echo Done: $?
|
||||||
|
Loading…
Reference in New Issue
Block a user