about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-08-04 22:47:36 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-08-04 22:47:36 +0200
commitc3f0e7052453fed04a696535145d40dfd2a3b6a3 (patch)
tree96d89673da625d9bd738a940a82abf602b111f84
parente6b1dceda0ab7958b7e989e4dbb5d8353bcc8d26 (diff)
downloadlr-c3f0e7052453fed04a696535145d40dfd2a3b6a3.tar.gz
lr-c3f0e7052453fed04a696535145d40dfd2a3b6a3.tar.xz
lr-c3f0e7052453fed04a696535145d40dfd2a3b6a3.zip
count_entries: fix when fi->fpath is "" (at toplevel)
Reported by @Profpatsch.
-rw-r--r--lr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index dd485c2..276abec 100644
--- a/lr.c
+++ b/lr.c
@@ -1250,7 +1250,7 @@ count_entries(struct fileinfo *fi)
 	if (!S_ISDIR(fi->sb.st_mode))
 		return 0;
 
-	d = opendir(fi->fpath);
+	d = opendir(fi->fpath[0] ? fi->fpath : ".");
 	if (!d)
 		return 0;
 	while ((de = readdir(d))) {