From 66f45e17a16b886d15f236f355bd51db9983a666 Mon Sep 17 00:00:00 2001 From: "Ben Russell (300178622)" Date: Sat, 7 Feb 2015 13:35:37 +1300 Subject: [PATCH] [0.2a-4] windows can die in a fucking fire --- include/common.h | 2 +- pkg/base/version.lua | 7 ++++--- src/lua.c | 11 +++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/common.h b/include/common.h index d59bed7..f21a013 100644 --- a/include/common.h +++ b/include/common.h @@ -23,7 +23,7 @@ #define VERSION_X 2 #define VERSION_Y 0 #define VERSION_A 1 -#define VERSION_Z 3 +#define VERSION_Z 4 // Remember to bump "Z" basically every time you change the engine! // Remember to bump the version in Lua too! // Remember to document API changes in a new version! diff --git a/pkg/base/version.lua b/pkg/base/version.lua index 1e1eda6..f7680e6 100644 --- a/pkg/base/version.lua +++ b/pkg/base/version.lua @@ -20,9 +20,9 @@ -- Thanks. --GM VERSION_ENGINE = { - cmp={0,2,0,1,3}, - num=8389632+3, - str="0.2a-3", + cmp={0,2,0,1,4}, + num=8389632+4, + str="0.2a-4", } --error(""..common.version.num) @@ -145,5 +145,6 @@ VERSION_BUGS = { {intro=8389632+1, fix=8389632+2, msg="Memory leak when reusing a VA in va_make"}, {intro=8389632+1, fix=8389632+2, msg="VA API lacks support for textures"}, {intro=8389632+2, fix=8389632+3, msg="Compat breakage with va_render_global and textures"}, +{intro=4259840+11, fix=8389632+4, msg="[Win32] Needs a workaround for a bug in MinGW's execv function"}, } diff --git a/src/lua.c b/src/lua.c index baf34d3..7662fde 100644 --- a/src/lua.c +++ b/src/lua.c @@ -98,8 +98,15 @@ int icelua_fn_client_mk_sys_execv(lua_State *L) SDL_Quit(); #ifdef WIN32 - if(main_oldcwd != NULL) - _chdir(main_oldcwd); + const char *follow = main_argv0; + while(*follow != '\x00') + { + if(*follow == '\\' || *follow == '/') + main_argv0 = follow+1; + + follow++; + } + //if(main_oldcwd != NULL) _chdir(main_oldcwd); #endif printf("argv0: [%s]\n", main_argv0); fflush(stdout);