Use wxFileName to resolve . and .. in documentation paths.

Fixes https://gitlab.com/kicad/code/kicad/issues/14564
This commit is contained in:
Jeff Young 2023-04-29 17:51:36 +01:00
parent a817b4c1ff
commit 08c773a0bf
1 changed files with 3 additions and 0 deletions

View File

@ -144,6 +144,9 @@ bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT
wxFileName currentFileName( fullfilename ); wxFileName currentFileName( fullfilename );
// Use wxWidgets to resolve any "." and ".." in the path
fullfilename = currentFileName.GetAbsolutePath();
wxString file_ext = currentFileName.GetExt(); wxString file_ext = currentFileName.GetExt();
if( file_ext.Lower() == wxT( "pdf" ) ) if( file_ext.Lower() == wxT( "pdf" ) )