From 772908ae80a92333731b6f31bdc6f9ab496fcb49 Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Sat, 25 Apr 2020 19:08:58 +0300 Subject: ALT: Add more taboo suffixes Signed-off-by: Alexey Gladkov --- config.c | 9 +++++++++ test/Makefile.am | 4 +++- test/test-0991.sh | 26 ++++++++++++++++++++++++++ test/test-0992.sh | 33 +++++++++++++++++++++++++++++++++ test/test-config.991.in | 9 +++++++++ test/test-config.992.in | 13 +++++++++++++ 6 files changed, 93 insertions(+), 1 deletion(-) create mode 100755 test/test-0991.sh create mode 100755 test/test-0992.sh create mode 100644 test/test-config.991.in create mode 100644 test/test-config.992.in diff --git a/config.c b/config.c index 9d196cc..86f8e85 100644 --- a/config.c +++ b/config.c @@ -142,6 +142,12 @@ static const char *const defTabooExts[] = { ".ucf-dist", ".ucf-new", ".ucf-old", + ".gz", + ".bz2", + ".xz", + ".[0-9]", + ".[0-9][0-9]", + ".[0-9][0-9][0-9]", "~" }; static const unsigned defTabooCount = sizeof(defTabooExts) / sizeof(char *); @@ -1857,6 +1863,9 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig) } } + if (!checkFile(globResult.gl_pathv[glob_count])) + continue; + newlog->files[newlog->numFiles] = strdup(globResult.gl_pathv[glob_count]); if (newlog->files[newlog->numFiles] == NULL) { diff --git a/test/Makefile.am b/test/Makefile.am index 67cfacc..2f3d9a5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -96,7 +96,9 @@ TEST_CASES = \ test-0102.sh \ test-0103.sh \ test-0104.sh \ - test-0105.sh + test-0105.sh \ + test-0991.sh \ + test-0992.sh EXTRA_DIST = \ compress \ diff --git a/test/test-0991.sh b/test/test-0991.sh new file mode 100755 index 0000000..587e86d --- /dev/null +++ b/test/test-0991.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +. ./test-common.sh + +cleanup 991 + +# ------------------------------- Test 991 ------------------------------------ +mkdir subdir +preptest subdir/sample.log 991 8 +$RLR test-config.991 --force + +checkoutput < subdir/sample.log +$RLR test-config.992 --force + +checkoutput <