Commit b1ec3986a7503e80e895f681e510f0312dfeacb7

Stefan Sperling 2019-02-04T11:51:19

skip "." and ".." in diff_fileindex_dir()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/fileindex.c b/lib/fileindex.c
index d25609a..2bfc6de 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -743,6 +743,11 @@ diff_fileindex_dir(struct got_fileindex *fileindex,
 
 	de = readdir(dir);
 	do {
+		if (strcmp(de->d_name, ".") == 0 ||
+		    strcmp(de->d_name, "..") == 0) {
+			de = readdir(dir);
+			continue;
+		}
 		if (de && *ie) {
 			int cmp = cmp_entries((*ie)->path, path, path_len,
 			    de->d_name);