diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-08-13 19:49:15 +0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-08-13 19:49:15 +0400 |
commit | 97f2308f40f1caa7b20b79d0ef4427a3cfb764ab (patch) | |
tree | 198dad34e29f8c8ae8ffb7d4052b04218122f6b7 | |
parent | 601b4e54981d685d0a3c6049622453e897e55c01 (diff) | |
parent | ebe20b66f095c8f89a5c1d16c5bd3cc98dad29ee (diff) |
Merge pull request #45 from moteus/master
Fix. Compile with MSVC and with gcc without `-std=c99`
-rw-r--r-- | src/lfs.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -438,6 +438,7 @@ static int make_dir (lua_State *L) { return 1; } + /* ** Removes a directory. ** @param #1 Directory path. @@ -457,6 +458,7 @@ static int remove_dir (lua_State *L) { return 1; } + /* ** Directory iterator */ @@ -569,6 +571,7 @@ static int dir_create_meta (lua_State *L) { return 1; } + /* ** Creates lock metatable. */ @@ -790,6 +793,7 @@ struct _stat_members members[] = { static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) { STAT_STRUCT info; const char *file = luaL_checkstring (L, 1); + int i; if (st(file, &info)) { lua_pushnil (L); @@ -798,7 +802,7 @@ static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) { } if (lua_isstring (L, 2)) { const char *member = lua_tostring (L, 2); - for (int i = 0; members[i].name; i++) { + for (i = 0; members[i].name; i++) { if (strcmp(members[i].name, member) == 0) { /* push member value and return */ members[i].push (L, &info); @@ -813,7 +817,7 @@ static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) { lua_newtable (L); } /* stores all members in table on top of the stack */ - for (int i = 0; members[i].name; i++) { + for (i = 0; members[i].name; i++) { lua_pushstring (L, members[i].name); members[i].push (L, &info); lua_rawset (L, -3); |