diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-17 13:23:10 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-17 13:24:16 +0000 |
commit | 5d710374afe4545d8e14c0559857b50ceceb1df3 (patch) | |
tree | 9cd4144e8e53193e39a602857fc417ec4c59bab2 /shell | |
parent | d82db8e9a618ddd9a11cc57aff37f687abb0effb (diff) | |
download | busybox-w32-5d710374afe4545d8e14c0559857b50ceceb1df3.tar.gz busybox-w32-5d710374afe4545d8e14c0559857b50ceceb1df3.tar.bz2 busybox-w32-5d710374afe4545d8e14c0559857b50ceceb1df3.zip |
ash: tidy up handling of -X option
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c index 29130db0e..0040fd3c8 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -514,10 +514,10 @@ struct globals_misc { | |||
514 | # define debug optlist[15 + BASH_PIPEFAIL] | 514 | # define debug optlist[15 + BASH_PIPEFAIL] |
515 | #endif | 515 | #endif |
516 | #if ENABLE_PLATFORM_MINGW32 | 516 | #if ENABLE_PLATFORM_MINGW32 |
517 | # define winxp optlist[14 + ENABLE_ASH_BASH_COMPAT + 2*DEBUG] | 517 | # define winxp optlist[14 + BASH_PIPEFAIL + 2*DEBUG] |
518 | #endif | 518 | #endif |
519 | #if ENABLE_ASH_NOCONSOLE | 519 | #if ENABLE_ASH_NOCONSOLE |
520 | # define noconsole optlist[15 + ENABLE_ASH_BASH_COMPAT + 2*DEBUG] | 520 | # define noconsole optlist[15 + BASH_PIPEFAIL + 2*DEBUG] |
521 | #endif | 521 | #endif |
522 | 522 | ||
523 | /* trap handler commands */ | 523 | /* trap handler commands */ |
@@ -14551,11 +14551,7 @@ exitshell(void) | |||
14551 | 14551 | ||
14552 | /* Don't inline: conserve stack of caller from having our locals too */ | 14552 | /* Don't inline: conserve stack of caller from having our locals too */ |
14553 | static NOINLINE void | 14553 | static NOINLINE void |
14554 | #if ENABLE_PLATFORM_MINGW32 | ||
14555 | init(int xp) | ||
14556 | #else | ||
14557 | init(void) | 14554 | init(void) |
14558 | #endif | ||
14559 | { | 14555 | { |
14560 | /* we will never free this */ | 14556 | /* we will never free this */ |
14561 | basepf.next_to_pgetc = basepf.buf = ckmalloc(IBUFSIZ); | 14557 | basepf.next_to_pgetc = basepf.buf = ckmalloc(IBUFSIZ); |
@@ -14615,7 +14611,7 @@ init(void) | |||
14615 | /* Convert backslashes to forward slashes in value but | 14611 | /* Convert backslashes to forward slashes in value but |
14616 | * not if we're on Windows XP or for variables known to | 14612 | * not if we're on Windows XP or for variables known to |
14617 | * cause problems */ | 14613 | * cause problems */ |
14618 | if ( !xp && strncmp(*envp, "SYSTEMROOT=", 11) != 0 && | 14614 | if ( !winxp && strncmp(*envp, "SYSTEMROOT=", 11) != 0 && |
14619 | strncmp(*envp, "COMSPEC=", 8) != 0 ) { | 14615 | strncmp(*envp, "COMSPEC=", 8) != 0 ) { |
14620 | convert_slashes(end+1); | 14616 | convert_slashes(end+1); |
14621 | } | 14617 | } |
@@ -14891,7 +14887,10 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
14891 | exception_handler = &jmploc; | 14887 | exception_handler = &jmploc; |
14892 | rootpid = getpid(); | 14888 | rootpid = getpid(); |
14893 | 14889 | ||
14894 | init(IF_PLATFORM_MINGW32(argc >= 2 && strcmp(argv[1], "-X") == 0)); | 14890 | #if ENABLE_PLATFORM_MINGW32 |
14891 | winxp = (argv[1] != NULL && strcmp(argv[1], "-X") == 0); | ||
14892 | #endif | ||
14893 | init(); | ||
14895 | setstackmark(&smark); | 14894 | setstackmark(&smark); |
14896 | 14895 | ||
14897 | #if ENABLE_PLATFORM_MINGW32 | 14896 | #if ENABLE_PLATFORM_MINGW32 |