summaryrefslogtreecommitdiffstats
path: root/exclude.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-24 01:57:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-24 01:57:46 +0000
commit321b4b38cb22eb640619cebcb1230c604b2e9297 (patch)
treebea175e053890b150463151752b7a49dc49c436e /exclude.cc
parentAdding upstream version 0.22. (diff)
downloadtarlz-55b423a248268565a60249908b592c6d07457192.tar.xz
tarlz-55b423a248268565a60249908b592c6d07457192.zip
Adding upstream version 0.23.upstream/0.23
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exclude.cc')
-rw-r--r--exclude.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/exclude.cc b/exclude.cc
index 876e04f..99491ca 100644
--- a/exclude.cc
+++ b/exclude.cc
@@ -33,15 +33,12 @@ std::vector< std::string > patterns; // list of patterns
void Exclude::add_pattern( const std::string & arg )
{ patterns.push_back( arg ); }
-void Exclude::clear() { patterns.clear(); }
-
bool Exclude::excluded( const char * const filename )
{
if( patterns.empty() ) return false;
const char * p = filename;
- while( *p )
- {
+ do {
for( unsigned i = 0; i < patterns.size(); ++i )
// ignore a trailing sequence starting with '/' in filename
#ifdef FNM_LEADING_DIR
@@ -52,6 +49,6 @@ bool Exclude::excluded( const char * const filename )
#endif
while( *p && *p != '/' ) ++p; // skip component
while( *p == '/' ) ++p; // skip slashes
- }
+ } while( *p );
return false;
}