From bd5014023b080fb1d05df1c57ba2f3cedc7bad12 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Mon, 19 May 2014 13:12:30 +0200 Subject: [PATCH] Fix error in Shadowing Fixes #299: Error in Shadowing --- src/findlib/shadowing.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/findlib/shadowing.c b/src/findlib/shadowing.c index f4f00a5e941..2389b25e97e 100644 --- a/src/findlib/shadowing.c +++ b/src/findlib/shadowing.c @@ -76,7 +76,9 @@ static inline bool check_include_pattern_shadowing(JCR *jcr, /* * See if one pattern shadows the other. */ - if (bstrncmp(pattern1, pattern2, MIN(len1, len2))) { + if (((len1 < len2 && pattern1[len1] == '\0' && IsPathSeparator(pattern2[len1])) || + (len1 > len2 && IsPathSeparator(pattern1[len2]) && pattern1[len1] == '\0')) && + bstrncmp(pattern1, pattern2, MIN(len1, len2))) { /* * If both directories have the same st_dev they shadow * each other e.g. are not on seperate filesystems.