Commit 8a7f3ef0 authored by Leah Neukirchen's avatar Leah Neukirchen

recurse: guard DT_DIR optimization

parent ab1a5d21
......@@ -1975,9 +1975,13 @@ recurse(char *path, struct history *h, int guessdir)
} else {
strcpy(path, de->d_name);
}
#if defined(DT_DIR) && defined(DT_UNKNOWN)
int guesssubdir = de->d_type == DT_DIR ||
(de->d_type == DT_LNK && resolve) ||
de->d_type == DT_UNKNOWN;
#else
int guesssubdir = 1;
#endif
if ((r = recurse(path, &new, guesssubdir))) {
closedir(d);
return r;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment