Skip to content

Commit

Permalink
Fix error in Shadowing
Browse files Browse the repository at this point in the history
Fixes #299: Error in Shadowing
  • Loading branch information
Marco van Wieringen committed May 23, 2014
1 parent 83821c3 commit 8832077
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/findlib/shadowing.c
Expand Up @@ -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.
Expand Down

0 comments on commit 8832077

Please sign in to comment.