diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-13 08:59:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-13 08:59:10 +0000 |
commit | 29867477a1c50b8cbea6212b8dd649a052778bf0 (patch) | |
tree | 070208b9f3add6d1757dc9281b7c8d113eb2768d /exclude.cc | |
parent | Adding upstream version 0.14. (diff) | |
download | tarlz-29867477a1c50b8cbea6212b8dd649a052778bf0.tar.xz tarlz-29867477a1c50b8cbea6212b8dd649a052778bf0.zip |
Adding upstream version 0.15.upstream/0.15
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exclude.cc')
-rw-r--r-- | exclude.cc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 } |