From 07cb1e0c757881874b5305c6e5bc872775f5a19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Draho=C5=A1?= Date: Mon, 9 Dec 2013 01:36:41 +0100 Subject: Loadlib fix for newer Cygwin releases --- src/loadlib_rel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/loadlib_rel.c b/src/loadlib_rel.c index b3f537b..40a8d5b 100644 --- a/src/loadlib_rel.c +++ b/src/loadlib_rel.c @@ -116,13 +116,17 @@ static void setprogdir (lua_State *L); ** Modified by the LuaDist project for UNIX platforms ** ========================================================================== */ -#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(_WIN32) #include #define _PATH_MAX MAX_PATH #else #define _PATH_MAX PATH_MAX #endif +#if defined (__CYGWIN__) + #include +#endif + #if defined(__linux__) || defined(__sun) #include /* readlink */ #endif @@ -145,7 +149,7 @@ static void setprogdir(lua_State *L) { #if defined(__CYGWIN__) char win_buff[_PATH_MAX + 1]; GetModuleFileNameA(NULL, win_buff, nsize); - cygwin_conv_to_posix_path(win_buff, progdir); + cygwin_conv_path(CCP_WIN_W_TO_POSIX, win_buff, progdir, nsize); n = strlen(progdir); #elif defined(_WIN32) n = GetModuleFileNameA(NULL, progdir, nsize); -- cgit v1.2.1 From aaf39ecc16c688f6a3804477f9355651534ddec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Draho=C5=A1?= Date: Mon, 9 Dec 2013 01:45:52 +0100 Subject: Correction of path format --- src/loadlib_rel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loadlib_rel.c b/src/loadlib_rel.c index 40a8d5b..c2e9b95 100644 --- a/src/loadlib_rel.c +++ b/src/loadlib_rel.c @@ -149,7 +149,7 @@ static void setprogdir(lua_State *L) { #if defined(__CYGWIN__) char win_buff[_PATH_MAX + 1]; GetModuleFileNameA(NULL, win_buff, nsize); - cygwin_conv_path(CCP_WIN_W_TO_POSIX, win_buff, progdir, nsize); + cygwin_conv_path(CCP_WIN_A_TO_POSIX, win_buff, progdir, nsize); n = strlen(progdir); #elif defined(_WIN32) n = GetModuleFileNameA(NULL, progdir, nsize); -- cgit v1.2.1