diff options
Diffstat (limited to 'src/lfs.c')
-rw-r--r-- | src/lfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -11,7 +11,7 @@ | |||
11 | ** lfs.touch (filepath [, atime [, mtime]]) | 11 | ** lfs.touch (filepath [, atime [, mtime]]) |
12 | ** lfs.unlock (fh) | 12 | ** lfs.unlock (fh) |
13 | ** | 13 | ** |
14 | ** $Id: lfs.c,v 1.27 2005/08/18 01:00:44 tomas Exp $ | 14 | ** $Id: lfs.c,v 1.28 2006/03/07 19:07:57 tuler Exp $ |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <errno.h> | 17 | #include <errno.h> |
@@ -276,10 +276,12 @@ static int remove_dir (lua_State *L) { | |||
276 | ** Directory iterator | 276 | ** Directory iterator |
277 | */ | 277 | */ |
278 | static int dir_iter (lua_State *L) { | 278 | static int dir_iter (lua_State *L) { |
279 | #ifdef _WIN32 | ||
280 | struct _finddata_t c_file; | ||
281 | #endif | ||
279 | dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); | 282 | dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); |
280 | luaL_argcheck (L, !d->closed, 1, "closed directory"); | 283 | luaL_argcheck (L, !d->closed, 1, "closed directory"); |
281 | #ifdef _WIN32 | 284 | #ifdef _WIN32 |
282 | struct _finddata_t c_file; | ||
283 | if (d->hFile == 0L) { /* first entry */ | 285 | if (d->hFile == 0L) { /* first entry */ |
284 | if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) { | 286 | if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) { |
285 | lua_pushnil (L); | 287 | lua_pushnil (L); |