diff options
author | tomas <tomas> | 2007-05-15 12:58:35 +0000 |
---|---|---|
committer | tomas <tomas> | 2007-05-15 12:58:35 +0000 |
commit | 7ee2d8e1b24a0ae3f671fc852e42301c017f0576 (patch) | |
tree | 08fef0ff940680741c17c8d905ec577ed06b094c /src/lfs.c | |
parent | 8033232c924123b670578a8cb13ec0843f4d65d3 (diff) | |
download | luafilesystem-7ee2d8e1b24a0ae3f671fc852e42301c017f0576.tar.gz luafilesystem-7ee2d8e1b24a0ae3f671fc852e42301c017f0576.tar.bz2 luafilesystem-7ee2d8e1b24a0ae3f671fc852e42301c017f0576.zip |
Compilation bug fix: ISO C90 forbids mixed declarations and code
Diffstat (limited to 'src/lfs.c')
-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; |