aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-06-22 16:44:23 +0100
committerRon Yorston <rmy@pobox.com>2024-06-22 16:44:23 +0100
commit98a0e0e272018a1ae2cc5cd4fa9775c5cfb33dec (patch)
treeefec06cd0ad50e6929cce41a4089a6a5f446d189 /libbb
parent790e37727319c3dd9c2d4e45dac9b6cc38a5d25f (diff)
downloadbusybox-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 'libbb')
-rw-r--r--libbb/appletlib.c2
-rw-r--r--libbb/messages.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index c90285ae9..121959376 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 SetErrorMode(SEM_FAILCRITICALERRORS); 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/libbb/messages.c b/libbb/messages.c
index 12079a2e0..27ba244d6 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -47,7 +47,8 @@ const char bbvar[] ALIGN1 =
47 "BB_OVERRIDE_APPLETS\0" \ 47 "BB_OVERRIDE_APPLETS\0" \
48 "BB_SKIP_ANSI_EMULATION\0" \ 48 "BB_SKIP_ANSI_EMULATION\0" \
49 "BB_TERMINAL_MODE\0" \ 49 "BB_TERMINAL_MODE\0" \
50 "BB_SYSTEMROOT\0"; 50 "BB_SYSTEMROOT\0" \
51 "BB_CRITICAL_ERROR_DIALOGS\0";
51#endif 52#endif
52const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL; 53const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL;
53/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, 54/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,