Compare commits
1 Commits
c6b393940b
...
e971af2326
| Author | SHA1 | Date | |
|---|---|---|---|
| e971af2326 |
@@ -138,10 +138,12 @@ Chunk* directory_scanner_next(DirectoryScanner* scanner) {
|
|||||||
|
|
||||||
if (S_ISDIR(stats.st_mode)) {
|
if (S_ISDIR(stats.st_mode)) {
|
||||||
int next_depth = scanner->current_depth + 1;
|
int next_depth = scanner->current_depth + 1;
|
||||||
if (scanner->max_depth <= 0 || next_depth < scanner->max_depth)
|
if (scanner->max_depth <= 0 || next_depth < scanner->max_depth) {
|
||||||
queue_enqueue(scanner->directories, dir_entry_create(cur_path, next_depth));
|
DirEntry* de = dir_entry_create(cur_path, next_depth);
|
||||||
else
|
if (!queue_enqueue(scanner->directories, de))
|
||||||
free(cur_path);
|
dir_entry_destroy(de);
|
||||||
|
}
|
||||||
|
free(cur_path);
|
||||||
} else {
|
} else {
|
||||||
if (scanner->max_depth > 0 && scanner->current_depth + 1 > scanner->max_depth) {
|
if (scanner->max_depth > 0 && scanner->current_depth + 1 > scanner->max_depth) {
|
||||||
free(cur_path);
|
free(cur_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user