[PATCH] fix virLogCleanerParseFilename logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We should return the full filename path when we don't have a match on
the third group of the regex.

Signed-off-by: David Negreira <david.negreira@xxxxxxxxxxxxx>
---
 src/logging/log_cleaner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/logging/log_cleaner.c b/src/logging/log_cleaner.c
index 4ee91843aa..d8e6ce9cdd 100644
--- a/src/logging/log_cleaner.c
+++ b/src/logging/log_cleaner.c
@@ -82,7 +82,7 @@ virLogCleanerParseFilename(const char *path,
     *rotated_index = 0;
     rotated_index_str = g_match_info_fetch(matchInfo, 3);
 
-    if (!rotated_index_str)
+    if (rotated_index_str)
         return chain_prefix;
 
     if (virStrToLong_i(rotated_index_str, NULL, 10, rotated_index) < 0) {
-- 
2.40.1



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux