summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-09-17 16:39:23 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-09-17 16:39:23 +0200
commit8a7f3ef0c2b013e9d889b39f24e56b54cb39e8e5 (patch)
treef6767bb427c3cedd416b24b234d4cfa49fef4771
parentab1a5d21b64b625dec383c87bba698dd2b2ec3f6 (diff)
downloadlr-8a7f3ef0c2b013e9d889b39f24e56b54cb39e8e5.tar.gz
lr-8a7f3ef0c2b013e9d889b39f24e56b54cb39e8e5.tar.xz
lr-8a7f3ef0c2b013e9d889b39f24e56b54cb39e8e5.zip
recurse: guard DT_DIR optimization
-rw-r--r--lr.c4
1 files changed, 4 insertions, 0 deletions
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;