Permalink
Browse files

Fix loop that calculates file extensions. Fix log statement for when …

…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 e5840c1b58a22dcd27461a37a74380c054174718
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ignore.c
@@ -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;
@@ -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;
}
}

0 comments on commit e5840c1

Please sign in to comment.