Fix logic error in FileResolvers.

If Normalize() was not needed after finding a searchpath then we were
never updating tname and just blindly returning it.

Fixes https://gitlab.com/kicad/code/kicad/issues/7670
This commit is contained in:
Jeff Young 2021-09-21 12:33:36 +01:00
parent 23c76cccf3
commit 24f3c49631
2 changed files with 5 additions and 2 deletions

View File

@ -377,6 +377,8 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
if( wxFileName::FileExists( fullPath ) )
{
tname = fullPath;
wxFileName tmp( fullPath );
if( tmp.Normalize() )

View File

@ -396,7 +396,9 @@ wxString S3D_RESOLVER::ResolvePath( const wxString& aFileName )
if( wxFileName::FileExists( fullPath ) )
{
wxFileName tmp( fullPath );
tname = fullPath;
wxFileName tmp( tname );
if( tmp.Normalize() )
tname = tmp.GetFullPath();
@ -928,7 +930,6 @@ bool S3D_RESOLVER::ValidateFileName( const wxString& aFileName, bool& hasAlias )
if( aliasEnd != wxString::npos )
lpath = aFileName.substr( aliasEnd + 1 );
}
if( wxString::npos != lpath.find_first_of( wxFileName::GetForbiddenChars() ) )