summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Drahoš <drahosp@gmail.com>2013-12-09 01:36:41 +0100
committerPeter Drahoš <drahosp@gmail.com>2013-12-09 01:36:41 +0100
commit07cb1e0c757881874b5305c6e5bc872775f5a19b (patch)
tree9c6d40c411e40f025122c5efc720774c41571795
parent467d3837ccc57dd301c279d52801ba80cfa94405 (diff)
downloadlua-07cb1e0c757881874b5305c6e5bc872775f5a19b.tar.gz
Loadlib fix for newer Cygwin releases
-rw-r--r--src/loadlib_rel.c8
1 files 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 <windows.h>
#define _PATH_MAX MAX_PATH
#else
#define _PATH_MAX PATH_MAX
#endif
+#if defined (__CYGWIN__)
+ #include <sys/cygwin.h>
+#endif
+
#if defined(__linux__) || defined(__sun)
#include <unistd.h> /* 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);