diff options
author | Ron Yorston <rmy@pobox.com> | 2024-06-22 16:44:23 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-06-22 16:44:23 +0100 |
commit | 98a0e0e272018a1ae2cc5cd4fa9775c5cfb33dec (patch) | |
tree | efec06cd0ad50e6929cce41a4089a6a5f446d189 /win32 | |
parent | 790e37727319c3dd9c2d4e45dac9b6cc38a5d25f (diff) | |
download | busybox-w32-98a0e0e272018a1ae2cc5cd4fa9775c5cfb33dec.tar.gz busybox-w32-98a0e0e272018a1ae2cc5cd4fa9775c5cfb33dec.tar.bz2 busybox-w32-98a0e0e272018a1ae2cc5cd4fa9775c5cfb33dec.zip |
win32: add env var to control error dialogs
If the environment variable BB_CRITICAL_ERROR_DIALOGS is set to
1 critical error dialogs are enabled. If unset or set to any
other value they aren't. In either case the error messages
introduced by commit 790e37727 (win32: revert 'don't set error
mode') are issued.
The shell exports BB_CRITICAL_ERROR_DIALOGS to the environment
immediately on any change so the setting takes effect at once.
Adds 104-160 bytes.
(GitHub issue #423)
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 4398f5462..49e1bcfa4 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -2507,3 +2507,9 @@ windows_env(void) | |||
2507 | } | 2507 | } |
2508 | return FALSE; | 2508 | return FALSE; |
2509 | } | 2509 | } |
2510 | |||
2511 | void FAST_FUNC | ||
2512 | change_critical_error_dialogs(const char *newval) | ||
2513 | { | ||
2514 | SetErrorMode(strcmp(newval, "1") == 0 ? 0 : SEM_FAILCRITICALERRORS); | ||
2515 | } | ||