From d35175c9e68a3ad252bfa22d266b8311df99a718 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 24 Sep 2022 03:57:49 +0200 Subject: Merging upstream version 0.23. Signed-off-by: Daniel Baumann --- exclude.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'exclude.cc') 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; } -- cgit v1.2.3