./src/rgsub.c in aliens-1.0.79 vs ./src/rgsub.c in aliens-1.0.82
- old
+ new
@@ -75,11 +75,11 @@
while ((p = strstr(p, find)) != NULL) {
++matches;
p += find_len;
}
- if (!num_matches) {
+ if (!matches) {
*use_orig = true;
return;
}
*use_orig = false;
*num_matches = matches;
@@ -290,11 +290,11 @@
return;
}
struct dirent *entry;
while ((entry = readdir(dir)) != NULL) {
- if ((!strcmp(entry->d_name, ".")) || strcmp(entry->d_name, ".."))
+ if ((!strcmp(entry->d_name, ".")) || (!strcmp(entry->d_name, "..")))
continue;
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s/%s", dirPath, entry->d_name);
@@ -318,11 +318,11 @@
struct stat statbuf;
if (stat(path, &statbuf) == -1) {
printf("Failed to get file information: %s\n", path);
continue;
}
-
+
if (S_ISDIR(statbuf.st_mode)) {
process_directory(path, one, two, false);
} else if (S_ISREG(statbuf.st_mode)) {
process_file(path, one, two);
}
@@ -385,19 +385,17 @@
actual_argc++;
}
}
len1 = lens[1];
len2 = lens[2];
- // printf("%d %d\n", actual_argc, actual_argc);
if (actual_argc == 3) {
process_directory(".", actual_argv[1], actual_argv[2], false);
} else if (actual_argc > 3) {
for (int i = 3; i < actual_argc; ++i) {
if (verbose_mode) {
printf("Processing directory '%s'\n", argv[i]);
}
- {}
process_directory(actual_argv[i], actual_argv[1], actual_argv[2], true);
}
}
return 0;
}
\ No newline at end of file