From 7c2b48fbb462fe8aafed64d114be5fee81579f72 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 29 Jun 2012 20:35:43 +0200 Subject: [PATCH] Fixed directory inclusion if the last rule is "include". --- HISTORY | 5 +++-- elem.c | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 7e22ce1f..aa1d003f 100644 --- a/HISTORY +++ b/HISTORY @@ -3,10 +3,11 @@ SnapRAID HISTORY 1.10 2012/6 =========== - * If a file is excluded, it prints explicitely which attribute caused the - exclusion. + * Fixed directory inclusion, in case the last rule is an "include" one. * Fixed very long paths in Windows. We now always use the special '\\?' prefix to remove the 260 chars limitation. + * If a file is excluded, it prints explicitely which attribute caused the + exclusion. * Automatically excludes also the temporary copy of content file, the one with the ".tmp" extension. * Avoid the Windows system to go in automatic sleep mode when running. diff --git a/elem.c b/elem.c index 38156808..1d9a7ac5 100644 --- a/elem.c +++ b/elem.c @@ -176,6 +176,12 @@ static int filter_element(tommy_list* filterlist, const char* sub, int is_dir) } } + /* directories are always included by default, otherwise we cannot apply rules */ + /* to the contained files */ + if (is_dir) + return 0; + + /* files are excluded/included depending of the last rule processed */ if (direction < 0) return -1;