Skip to content

Commit

Permalink
Fix cryptic Lua error when failing to opendir() in walk_path.
Browse files Browse the repository at this point in the history
Closes GH-42.
  • Loading branch information
deplinenoise committed Sep 17, 2010
1 parent 0ee7cce commit 83d9bc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/luafs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#ifdef _WIN32
#include <windows.h>
#elif defined(__APPLE__) || defined(linux)
#include <errno.h>
#include <sys/stat.h>
#include <dirent.h>
#else
Expand Down Expand Up @@ -94,7 +95,7 @@ static void scan_directory(lua_State* L, const char* path)
const size_t path_len = strlen(path);

if (!(dir = opendir(path)))
return;
luaL_error(L, "can't opendir \"%s\": %s", path, strerror(errno));

if (path_len + 1 > sizeof(full_fn))
{
Expand Down

0 comments on commit 83d9bc7

Please sign in to comment.