diff options
Diffstat (limited to 'src/host/os_match.c')
-rw-r--r-- | src/host/os_match.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/host/os_match.c b/src/host/os_match.c index a267381..5ccc04d 100644 --- a/src/host/os_match.c +++ b/src/host/os_match.c @@ -57,9 +57,10 @@ int os_matchisfile(lua_State* L) int os_matchnext(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); - if (m->handle == INVALID_HANDLE_VALUE) + if (m->handle == INVALID_HANDLE_VALUE) { return 0; - + } + while (m) /* loop forever */ { if (!m->is_first) @@ -69,11 +70,8 @@ int os_matchnext(lua_State* L) } m->is_first = 0; - if (m->entry.cFileName[0] != '.') - { - lua_pushboolean(L, 1); - return 1; - } + lua_pushboolean(L, 1); + return 1; } return 0; @@ -155,7 +153,7 @@ int os_matchisfile(lua_State* L) lua_pushboolean(L, S_ISREG(info.st_mode)); return 1; } - + return 0; } @@ -164,12 +162,12 @@ int os_matchnext(lua_State* L) MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); if (m->handle == NULL) return 0; - + m->entry = readdir(m->handle); while (m->entry != NULL) { const char* name = m->entry->d_name; - if (name[0] != '.' && fnmatch(m->mask, name, 0) == 0) + if (fnmatch(m->mask, name, 0) == 0) { lua_pushboolean(L, 1); return 1; |