summaryrefslogtreecommitdiffstats
path: root/exclude.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-13 08:59:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-13 08:59:14 +0000
commitbab86e3bc6fcc2b148d2a58247e27c765b2b1471 (patch)
treea21a640ddd20d20c6d01cfe1f13b5494722fcb1c /exclude.cc
parentReleasing debian version 0.14-1. (diff)
downloadtarlz-bab86e3bc6fcc2b148d2a58247e27c765b2b1471.tar.xz
tarlz-bab86e3bc6fcc2b148d2a58247e27c765b2b1471.zip
Merging upstream version 0.15.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exclude.cc')
-rw-r--r--exclude.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/exclude.cc b/exclude.cc
index fc9d67d..1bdae6e 100644
--- a/exclude.cc
+++ b/exclude.cc
@@ -47,7 +47,12 @@ bool Exclude::excluded( const char * const filename )
while( *p )
{
for( unsigned i = 0; i < patterns.size(); ++i )
+#ifdef FNM_LEADING_DIR
if( fnmatch( patterns[i].c_str(), p, FNM_LEADING_DIR ) == 0 ) return true;
+#else
+ if( fnmatch( patterns[i].c_str(), p, 0 ) == 0 ||
+ fnmatch( ( patterns[i] + "/*" ).c_str(), p, 0 ) == 0 ) return true;
+#endif
while( *p && *p != '/' ) ++p; // skip component
while( *p == '/' ) ++p; // skip slashes
}