about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-02-26 12:34:57 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-02-26 12:34:57 +0100
commitb2bfdf1c9f7fa149790eda8bb51dda56412d6b80 (patch)
treefc377daf68ef59e8c46cdc2326cfef6d5249f7d8 /lr.c
parentff571c5ca19b74869d05f352a2afae00781d87cc (diff)
downloadlr-b2bfdf1c9f7fa149790eda8bb51dda56412d6b80.tar.gz
lr-b2bfdf1c9f7fa149790eda8bb51dda56412d6b80.tar.xz
lr-b2bfdf1c9f7fa149790eda8bb51dda56412d6b80.zip
do not count . and .. as entries
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index e6265c3..ee3119a 100644
--- a/lr.c
+++ b/lr.c
@@ -1654,11 +1654,11 @@ recurse(char *path, struct history *h)
 		if (d) {
 			struct dirent *de;
 			while ((de = readdir(d))) {
-				entries++;
 				if (de->d_name[0] == '.' &&
 				    (!de->d_name[1] ||
 				     (de->d_name[1]=='.' && !de->d_name[2])))
 					continue;
+				entries++;
 				if (strlen(de->d_name) >= PATH_MAX-l) {
 					errno = ENAMETOOLONG;
 					closedir(d);