From 08c773a0bf1f49ce86279f37db78eaf3cf1caaa0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 29 Apr 2023 17:51:36 +0100 Subject: [PATCH] Use wxFileName to resolve . and .. in documentation paths. Fixes https://gitlab.com/kicad/code/kicad/issues/14564 --- common/eda_doc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/eda_doc.cpp b/common/eda_doc.cpp index 0b0c19c52f..1300f7b793 100644 --- a/common/eda_doc.cpp +++ b/common/eda_doc.cpp @@ -144,6 +144,9 @@ bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT wxFileName currentFileName( fullfilename ); + // Use wxWidgets to resolve any "." and ".." in the path + fullfilename = currentFileName.GetAbsolutePath(); + wxString file_ext = currentFileName.GetExt(); if( file_ext.Lower() == wxT( "pdf" ) )