This commit is contained in:
Glenn Maynard
2005-11-02 15:45:45 +00:00
parent 937721f718
commit 6c859a7631
+3 -6
View File
@@ -239,26 +239,23 @@ void FilenameDB::GetFilesSimpleMatch( const CString &sDir, const CString &sMask,
{ {
/* No; just do a regular search. */ /* No; just do a regular search. */
GetFilesEqualTo( sDir, sMask, asOut, bOnlyDirs ); GetFilesEqualTo( sDir, sMask, asOut, bOnlyDirs );
return;
} }
else
{
size_t second_pos = sMask.find_first_of( '*', first_pos+1 ); size_t second_pos = sMask.find_first_of( '*', first_pos+1 );
if( second_pos == sMask.npos ) if( second_pos == sMask.npos )
{ {
/* Only one *: "A*B". */ /* Only one *: "A*B". */
/* XXX: "_blank.png*.png" shouldn't match the file "_blank.png". */ /* XXX: "_blank.png*.png" shouldn't match the file "_blank.png". */
GetFilesMatching( sDir, sMask.substr(0, first_pos), "", sMask.substr(first_pos+1), asOut, bOnlyDirs ); GetFilesMatching( sDir, sMask.substr(0, first_pos), "", sMask.substr(first_pos+1), asOut, bOnlyDirs );
return;
} }
else
{
/* Two *s: "A*B*C". */ /* Two *s: "A*B*C". */
GetFilesMatching( sDir, GetFilesMatching( sDir,
sMask.substr(0, first_pos), sMask.substr(0, first_pos),
sMask.substr(first_pos+1, second_pos-first_pos-1), sMask.substr(first_pos+1, second_pos-first_pos-1),
sMask.substr(second_pos+1), asOut, bOnlyDirs ); sMask.substr(second_pos+1), asOut, bOnlyDirs );
} }
}
}
/* /*
* Get the FileSet for dir; if create is true, create the FileSet if necessary. * Get the FileSet for dir; if create is true, create the FileSet if necessary.