From 8a7f3ef0c2b013e9d889b39f24e56b54cb39e8e5 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 17 Sep 2017 16:39:23 +0200 Subject: recurse: guard DT_DIR optimization --- lr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lr.c') diff --git a/lr.c b/lr.c index 4e4b1c5..aa6b0f1 100644 --- a/lr.c +++ b/lr.c @@ -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; -- cgit 1.4.1