From 5cb0d77851770950d4b9f0d4100318abc5b2dd10 Mon Sep 17 00:00:00 2001 From: uid20006 Date: Tue, 16 Aug 2005 13:47:58 +0000 Subject: moved luaL_argcheck call. --- src/lfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lfs.c b/src/lfs.c index b2e04f6..8d59f90 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -11,7 +11,7 @@ ** lfs.touch (filepath [, atime [, mtime]]) ** lfs.unlock (fh) ** -** $Id: lfs.c,v 1.25 2005/08/16 00:11:15 uid20013 Exp $ +** $Id: lfs.c,v 1.26 2005/08/16 13:47:58 uid20006 Exp $ */ #include @@ -277,9 +277,9 @@ static int remove_dir (lua_State *L) { */ static int dir_iter (lua_State *L) { dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); - luaL_argcheck (L, !d->closed, 1, "closed directory"); #ifdef _WIN32 struct _finddata_t c_file; + luaL_argcheck (L, !d->closed, 1, "closed directory"); if (d->hFile == 0L) { /* first entry */ if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) { lua_pushnil (L); @@ -302,6 +302,7 @@ static int dir_iter (lua_State *L) { } #else struct dirent *entry; + luaL_argcheck (L, !d->closed, 1, "closed directory"); if ((entry = readdir (d->dir)) != NULL) { lua_pushstring (L, entry->d_name); return 1; -- cgit v1.2.3-55-g6feb