diff options
| author | uid20006 <uid20006> | 2005-08-16 13:47:58 +0000 |
|---|---|---|
| committer | uid20006 <uid20006> | 2005-08-16 13:47:58 +0000 |
| commit | 5cb0d77851770950d4b9f0d4100318abc5b2dd10 (patch) | |
| tree | 3b2b9c01749b13a5164e26be7b0ba03955d4febf /src | |
| parent | e224c98838fd37372eb9ca592f30e3b888d1cc3a (diff) | |
| download | luafilesystem-5cb0d77851770950d4b9f0d4100318abc5b2dd10.tar.gz luafilesystem-5cb0d77851770950d4b9f0d4100318abc5b2dd10.tar.bz2 luafilesystem-5cb0d77851770950d4b9f0d4100318abc5b2dd10.zip | |
moved luaL_argcheck call.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lfs.c | 5 |
1 files changed, 3 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.25 2005/08/16 00:11:15 uid20013 Exp $ | 14 | ** $Id: lfs.c,v 1.26 2005/08/16 13:47:58 uid20006 Exp $ |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <errno.h> | 17 | #include <errno.h> |
| @@ -277,9 +277,9 @@ static int remove_dir (lua_State *L) { | |||
| 277 | */ | 277 | */ |
| 278 | static int dir_iter (lua_State *L) { | 278 | static int dir_iter (lua_State *L) { |
| 279 | dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); | 279 | dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); |
| 280 | luaL_argcheck (L, !d->closed, 1, "closed directory"); | ||
| 281 | #ifdef _WIN32 | 280 | #ifdef _WIN32 |
| 282 | struct _finddata_t c_file; | 281 | struct _finddata_t c_file; |
| 282 | luaL_argcheck (L, !d->closed, 1, "closed directory"); | ||
| 283 | if (d->hFile == 0L) { /* first entry */ | 283 | if (d->hFile == 0L) { /* first entry */ |
| 284 | if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) { | 284 | if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) { |
| 285 | lua_pushnil (L); | 285 | lua_pushnil (L); |
| @@ -302,6 +302,7 @@ static int dir_iter (lua_State *L) { | |||
| 302 | } | 302 | } |
| 303 | #else | 303 | #else |
| 304 | struct dirent *entry; | 304 | struct dirent *entry; |
| 305 | luaL_argcheck (L, !d->closed, 1, "closed directory"); | ||
| 305 | if ((entry = readdir (d->dir)) != NULL) { | 306 | if ((entry = readdir (d->dir)) != NULL) { |
| 306 | lua_pushstring (L, entry->d_name); | 307 | lua_pushstring (L, entry->d_name); |
| 307 | return 1; | 308 | return 1; |
