We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c61171 commit 9c79ce5Copy full SHA for 9c79ce5
fs/src/fs.cpp
@@ -404,7 +404,8 @@ int listdir(lua_State* L)
404
405
uv_dirent_t dir;
406
int i = 0;
407
- while (uv_fs_scandir_next(req, &dir) != UV_EOF)
+ int err = 0;
408
+ while ((err = uv_fs_scandir_next(req, &dir)) >= 0)
409
{
410
lua_pushinteger(L, ++i);
411
@@ -418,9 +419,11 @@ int listdir(lua_State* L)
418
419
420
lua_settable(L, -3);
421
}
-
422
delete req;
423
424
+ if (err != UV_EOF)
425
+ luaL_errorL(L, "%s", uv_strerror(err));
426
+
427
return 1;
428
429
);
0 commit comments