From ec8b602f0cc19fb80bf378c787f1a92e2d8bf528 Mon Sep 17 00:00:00 2001 From: Peter Haag Date: Sat, 14 Oct 2023 16:54:44 +0200 Subject: [PATCH] Check time window, if given, of a multi file selection --- src/lib/flist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/flist.c b/src/lib/flist.c index 976e3c1f..f5fc858c 100755 --- a/src/lib/flist.c +++ b/src/lib/flist.c @@ -211,7 +211,7 @@ static queue_t *file_queue = NULL; /* Function prototypes */ -static void GetFileList(char *path); +static void GetFileList(char *path, timeWindow_t *timeWindow); static void CleanPath(char *entry); @@ -363,7 +363,7 @@ static void CreateDirListFilter(char *first_path, char *last_path, int file_list } // End of CreateDirListFilter -static void GetFileList(char *path) { +static void GetFileList(char *path, timeWindow_t *timeWindow) { struct stat stat_buf; char *last_file_ptr, *first_path, *last_path; int levels_first_file, levels_last_file, file_list_level; @@ -736,7 +736,9 @@ static void GetFileList(char *path) { (dir_entry_filter[fts_level].last_entry && (strcmp(ftsent->fts_name, dir_entry_filter[fts_level].last_entry) > 0)))) continue; - queue_push(file_queue, strdup(ftsent->fts_path)); + if (CheckTimeWindow(ftsent->fts_path, timeWindow)) { + queue_push(file_queue, strdup(ftsent->fts_path)); + } break; } } @@ -849,7 +851,7 @@ static void *FileLister_thr(void *arg) { if (flist->multiple_files) { // use multiple files - GetFileList(flist->multiple_files); + GetFileList(flist->multiple_files, flist->timeWindow); } else if (single_file) { CleanPath(single_file);