This commit is contained in:
@@ -13,6 +13,26 @@
|
||||
#include <string.h>
|
||||
#include <threads.h>
|
||||
|
||||
static const char* filename_from_path(const char* path) {
|
||||
const char* slash = strrchr(path, '/');
|
||||
return slash ? slash + 1 : path;
|
||||
}
|
||||
|
||||
static bool should_exclude_file(const Config* config, const char* filename) {
|
||||
for (int i = 0; i < config->exclude_count; i++) {
|
||||
if (glob_match(config->exclude_patterns[i], filename))
|
||||
return true;
|
||||
}
|
||||
if (config->include_count > 0) {
|
||||
for (int i = 0; i < config->include_count; i++) {
|
||||
if (glob_match(config->include_patterns[i], filename))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
PipelineContextSender* pipeline_context_sender_create(Config* config, Queue* queue_scanner,
|
||||
Queue* queue_loader) {
|
||||
PipelineContextSender* context = malloc(sizeof(PipelineContextSender));
|
||||
@@ -155,8 +175,10 @@ int write_thread(void* pipeline_context) {
|
||||
free(root_directory);
|
||||
return thrd_success;
|
||||
}
|
||||
if (save_to_disk)
|
||||
file_save_to_disk(root_directory, file);
|
||||
if (save_to_disk) {
|
||||
if (!should_exclude_file(context->config, filename_from_path(file->path)))
|
||||
file_save_to_disk(root_directory, file);
|
||||
}
|
||||
file_destroy(file);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user