We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58e9cf2 commit 20b2551Copy full SHA for 20b2551
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,12 @@ int listdir(lua_State* L)
418
419
420
lua_settable(L, -3);
421
}
-
422
+
423
delete req;
424
425
+ if (err != UV_EOF)
426
+ luaL_errorL(L, "%s", uv_strerror(err));
427
428
return 1;
429
430
);
0 commit comments