diff options
-rw-r--r-- | src/lfs.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -84,9 +84,11 @@ | |||
84 | #else | 84 | #else |
85 | #define getcwd_error strerror(errno) | 85 | #define getcwd_error strerror(errno) |
86 | #ifdef _WIN32 | 86 | #ifdef _WIN32 |
87 | #define LFS_MAXPATHLEN MAX_PATH // MAX_PATH seems to be 260. Seems kind of small. Is there a better one? | 87 | /* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */ |
88 | #define LFS_MAXPATHLEN MAX_PATH | ||
88 | #else | 89 | #else |
89 | #include <sys/param.h> // for MAXPATHLEN | 90 | /* For MAXPATHLEN: */ |
91 | #include <sys/param.h> | ||
90 | #define LFS_MAXPATHLEN MAXPATHLEN | 92 | #define LFS_MAXPATHLEN MAXPATHLEN |
91 | #endif | 93 | #endif |
92 | #endif | 94 | #endif |
@@ -169,7 +171,7 @@ static int change_dir (lua_State *L) { | |||
169 | */ | 171 | */ |
170 | static int get_dir (lua_State *L) { | 172 | static int get_dir (lua_State *L) { |
171 | char *path; | 173 | char *path; |
172 | // Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. | 174 | /* Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. */ |
173 | char buf[LFS_MAXPATHLEN]; | 175 | char buf[LFS_MAXPATHLEN]; |
174 | if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) { | 176 | if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) { |
175 | lua_pushnil(L); | 177 | lua_pushnil(L); |