Merge pull request #742 from Areloch/invisibleFileFix

Tweaks handling of "invisible" files
This commit is contained in:
Brian Roberts 2022-03-16 03:30:45 -05:00 committed by GitHub
commit 3411dab754
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -395,6 +395,15 @@ DefineEngineFunction(isFile, bool, ( const char* fileName ),,
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), cleanfilename.c_str());
Torque::Path givenPath(Torque::Path::CompressPath(sgScriptFilenameBuffer));
if (givenPath.getFileName().isEmpty() && givenPath.getExtension().isNotEmpty())
{
//specially named or hidden files, like .gitignore parse incorrectly due to having
//"no" filename, so we adjust that
givenPath.setFileName(String(".") + givenPath.getExtension());
givenPath.setExtension("");
}
return Torque::FS::IsFile(givenPath);
}

View file

@ -750,10 +750,6 @@ S32 MountSystem::findByPattern( const Path &inBasePath, const String &inFilePatt
while ( dir->read( &attrs ) )
{
// skip hidden files
if ( attrs.name.c_str()[0] == '.' )
continue;
String name( attrs.name );
if ( (attrs.flags & FileNode::Directory) && inRecursive )