Skip to content

Commit 4c41760

Browse files
authored
Merge pull request earlephilhower#14 from xoseperez/master
Check for current dir more explicitly
2 parents 8c7cd3c + e563eed commit 4c41760

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ int addFiles(const char* dirname, const char* subPath) {
175175

176176
// Read files from directory.
177177
while ((ent = readdir (dir)) != NULL) {
178+
178179
// Ignore dir itself.
179-
if (ent->d_name[0] == '.')
180+
if ((strcmp(ent->d_name, ".") == 0) || (strcmp(ent->d_name, "..") == 0)) {
180181
continue;
182+
}
181183

182184
std::string fullpath = dirPath;
183185
fullpath += ent->d_name;

0 commit comments

Comments
 (0)