diff options
author | Ron Yorston <rmy@pobox.com> | 2024-06-23 09:06:19 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-06-23 09:06:19 +0100 |
commit | 1b094d366f808a2ebc4824004f0d6f75f13c09cb (patch) | |
tree | f285b99619a22d6be08f8fba20a9f27496dc616d | |
parent | 89ecbdcaab6ad1510a9f2058c4585ab4c17be743 (diff) | |
download | busybox-w32-1b094d366f808a2ebc4824004f0d6f75f13c09cb.tar.gz busybox-w32-1b094d366f808a2ebc4824004f0d6f75f13c09cb.tar.bz2 busybox-w32-1b094d366f808a2ebc4824004f0d6f75f13c09cb.zip |
win32: code shrink BB_CRITICAL_ERROR_DIALOGS
Rewrite the test for the value of BB_CRITICAL_ERROR_DIALOGS.
Saves 16-48 bytes.
-rw-r--r-- | libbb/appletlib.c | 2 | ||||
-rw-r--r-- | win32/mingw.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 121959376..54be59f2d 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1352,7 +1352,7 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
1352 | 1352 | ||
1353 | /* Have this process handle critical errors itself: the default | 1353 | /* Have this process handle critical errors itself: the default |
1354 | * system-generated error dialogs may be inconvenient. */ | 1354 | * system-generated error dialogs may be inconvenient. */ |
1355 | change_critical_error_dialogs(getenv(BB_CRITICAL_ERROR_DIALOGS) ?: ""); | 1355 | change_critical_error_dialogs(getenv(BB_CRITICAL_ERROR_DIALOGS)); |
1356 | #endif | 1356 | #endif |
1357 | 1357 | ||
1358 | #if defined(__MINGW64_VERSION_MAJOR) | 1358 | #if defined(__MINGW64_VERSION_MAJOR) |
diff --git a/win32/mingw.c b/win32/mingw.c index 6ad514ad4..467e4a33d 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -2513,5 +2513,6 @@ windows_env(void) | |||
2513 | void FAST_FUNC | 2513 | void FAST_FUNC |
2514 | change_critical_error_dialogs(const char *newval) | 2514 | change_critical_error_dialogs(const char *newval) |
2515 | { | 2515 | { |
2516 | SetErrorMode(strcmp(newval, "1") == 0 ? 0 : SEM_FAILCRITICALERRORS); | 2516 | SetErrorMode(newval && newval[0] == '1' && newval[1] == '\0' ? |
2517 | 0 : SEM_FAILCRITICALERRORS); | ||
2517 | } | 2518 | } |