Allow opening directories non-recursively

This commit is contained in:
Paride Legovini
2016-09-28 18:59:15 +02:00
committed by Bert Münnich
parent d69f39e3aa
commit 86dc6860f9
5 changed files with 8 additions and 10 deletions

6
main.c
View File

@ -818,11 +818,7 @@ int main(int argc, char **argv)
if (!S_ISDIR(fstats.st_mode)) {
check_add_file(filename, true);
} else {
if (!options->recursive) {
error(0, 0, "%s: Is a directory", filename);
continue;
}
if (r_opendir(&dir, filename) < 0) {
if (r_opendir(&dir, filename, options->recursive) < 0) {
error(0, errno, "%s", filename);
continue;
}