Skip to content

Commit 52d042f

Browse files
committed
Correct file size calculation
1 parent cad4e4a commit 52d042f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cli/filelister.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,11 @@ static void addFiles2(std::map<std::string, std::size_t> &files,
186186
if (stat(path.c_str(), &file_stat) != -1) {
187187
if ((file_stat.st_mode & S_IFMT) == S_IFDIR) {
188188
DIR * dir = opendir(path.c_str());
189-
190189
if (!dir)
191190
return;
192191

193192
dirent entry;
194193
dirent * dir_result;
195-
196194
std::string new_path;
197195
new_path.reserve(path.length() + 100);// prealloc some memory to avoid constant new/deletes in loop
198196

@@ -210,6 +208,7 @@ static void addFiles2(std::map<std::string, std::size_t> &files,
210208
}
211209
} else {
212210
if (Path::acceptFile(new_path, extra) && !ignored.match(new_path)) {
211+
stat(new_path.c_str(), &file_stat);
213212
files[new_path] = file_stat.st_size;
214213
}
215214
}

0 commit comments

Comments
 (0)