Skip to content

Commit

Permalink
Fix loop that calculates file extensions. Fix log statement for when …
Browse files Browse the repository at this point in the history
…an extension is ignored. This fixes #598. I'm really surprised this didn't crash. Oops.
  • Loading branch information
ggreer committed Feb 8, 2015
1 parent 808b32d commit e5840c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ignore.c
Expand Up @@ -378,7 +378,7 @@ int filename_filter(const char *path, const struct dirent *dir, void *baton) {
log_debug("path_start %s filename %s", path_start, filename);

const char *extension = NULL;
for (i = filename_len - 1; filename_len > 1; i--) {
for (i = filename_len - 1; i > 0; i--) {
if (filename[i] == '.') {
extension = filename + i + 1;
break;
Expand All @@ -397,7 +397,7 @@ int filename_filter(const char *path, const struct dirent *dir, void *baton) {
if (extension) {
int match_pos = binary_search(extension, ig->extensions, 0, ig->extensions_len);
if (match_pos >= 0) {
log_debug("file %s ignored because name matches extension %s", extension, ig->extensions[match_pos]);
log_debug("file %s ignored because name matches extension %s", filename, ig->extensions[match_pos]);
return 0;
}
}
Expand Down

0 comments on commit e5840c1

Please sign in to comment.