diff options
| author | Saikari <[email protected]> | 2026-02-05 23:36:25 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-02-05 23:36:25 +0300 |
| commit | b51f3b5f386c18504be698ea9c14953c8b289605 (patch) | |
| tree | 602fc0e838d8331970aa03e5412a5c744ff5e99f /core/src/xmake | |
| parent | bb7879934dca1ef7b26584f4dfadc29462d5a059 (diff) | |
fix logic
Diffstat (limited to 'core/src/xmake')
| -rw-r--r-- | core/src/xmake/process/openv.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/src/xmake/process/openv.c b/core/src/xmake/process/openv.c index 223d2d774..b9020cb2c 100644 --- a/core/src/xmake/process/openv.c +++ b/core/src/xmake/process/openv.c @@ -34,6 +34,9 @@ defined(TB_CONFIG_OS_HAIKU) || defined(TB_COMPILER_IS_MINGW) #include <signal.h> #endif +#ifdef TB_CONFIG_OS_WINDOWS +#include <windows.h> +#endif /* ////////////////////////////////////////////////////////////////////////////////////// * implementation @@ -100,6 +103,12 @@ tb_int_t xm_process_openv(lua_State *lua) { // init attributes tb_process_attr_t attr = { 0 }; +#ifdef TB_CONFIG_OS_WINDOWS + // the error mode + UINT old_error_mode = 0; + tb_bool_t set_error_mode = tb_false; +#endif + // get option arguments tb_bool_t exclusive = tb_false; tb_size_t envn = 0; @@ -130,6 +139,17 @@ tb_int_t xm_process_openv(lua_State *lua) { } lua_pop(lua, 1); +#ifdef TB_CONFIG_OS_WINDOWS + // save winos error mode? + lua_pushstring(lua, "winos_error_mode_gui"); + lua_gettable(lua, 3); + if (lua_toboolean(lua, -1)) { + old_error_mode = SetErrorMode(0); + set_error_mode = tb_true; + } + lua_pop(lua, 1); +#endif + // get curdir lua_pushstring(lua, "curdir"); lua_gettable(lua, 3); @@ -323,6 +343,13 @@ tb_int_t xm_process_openv(lua_State *lua) { lua_pushnil(lua); } +#ifdef TB_CONFIG_OS_WINDOWS + // restore error mode + if (set_error_mode) { + SetErrorMode(old_error_mode); + } +#endif + // exit argv if (argv) { tb_free(argv); |
