diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -14,7 +14,7 @@ | |||
14 | ** lfs.touch (filepath [, atime [, mtime]]) | 14 | ** lfs.touch (filepath [, atime [, mtime]]) |
15 | ** lfs.unlock (fh) | 15 | ** lfs.unlock (fh) |
16 | ** | 16 | ** |
17 | ** $Id: lfs.c,v 1.36 2007/05/08 19:23:12 carregal Exp $ | 17 | ** $Id: lfs.c,v 1.37 2007/05/15 12:58:35 tomas Exp $ |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <errno.h> | 20 | #include <errno.h> |
@@ -254,6 +254,8 @@ static int remove_dir (lua_State *L) { | |||
254 | static int dir_iter (lua_State *L) { | 254 | static int dir_iter (lua_State *L) { |
255 | #ifdef _WIN32 | 255 | #ifdef _WIN32 |
256 | struct _finddata_t c_file; | 256 | struct _finddata_t c_file; |
257 | #else | ||
258 | struct dirent *entry; | ||
257 | #endif | 259 | #endif |
258 | dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); | 260 | dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); |
259 | luaL_argcheck (L, !d->closed, 1, "closed directory"); | 261 | luaL_argcheck (L, !d->closed, 1, "closed directory"); |
@@ -279,7 +281,6 @@ static int dir_iter (lua_State *L) { | |||
279 | } | 281 | } |
280 | } | 282 | } |
281 | #else | 283 | #else |
282 | struct dirent *entry; | ||
283 | if ((entry = readdir (d->dir)) != NULL) { | 284 | if ((entry = readdir (d->dir)) != NULL) { |
284 | lua_pushstring (L, entry->d_name); | 285 | lua_pushstring (L, entry->d_name); |
285 | return 1; | 286 | return 1; |