Skip to content

Commit e563eed

Browse files
author
Xose Pérez
committed
Check for current dir more explicitly, allowing dot-starting files to be added to the image
1 parent b7ff183 commit e563eed

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)