Permalink
Browse files

filefind: Fix issue where a symbolic link pointing to a non-existent …

…directory aborted the glob run
  • Loading branch information...
jjensen committed Jan 26, 2017
1 parent 9f7dfdc commit 019bc7d2db0ac648acc379debe76ecdbc359ba95
Showing with 4 additions and 2 deletions.
  1. +4 −2 Src/Modules/filefind/src/fileglob.c
@@ -1196,12 +1196,14 @@ int fileglob_Next(fileglob* self) {
buffer_addstring(&wildcardBuff, "\\*.*", 5);
context->handle = FindFirstFile(buffer_ptr(&wildcardBuff), &context->fd);
buffer_free(&wildcardBuff);
if (context->handle == INVALID_HANDLE_VALUE) return 0;
if (context->handle == INVALID_HANDLE_VALUE)
goto NextContext;
#else
context->dirp = opendir(path);
if (context->dirp == NULL) return 0;
context->dp = readdir(context->dirp);
if (!context->dp) return 0;
if (!context->dp)
goto NextContext;
#endif
while (1) {

0 comments on commit 019bc7d

Please sign in to comment.