Fix int ExecuteFile(...) incorrect behavior with quoted filename.

It uses a wxExecute() version that add quotes to filename, so the final
filename was incorrect.
Fixes #9292
https://gitlab.com/kicad/code/kicad/issues/9292
This commit is contained in:
jean-pierre charras 2021-10-01 17:26:01 +02:00
parent dd1d36d40a
commit e96108d3c8
1 changed files with 8 additions and 1 deletions

View File

@ -140,7 +140,14 @@ int ExecuteFile( const wxString& aEditorName, const wxString& aFileName, wxProce
args[i++] = param.wc_str();
if( !aFileName.IsEmpty() )
args[i++] = aFileName.wc_str();
{
wxString name = aFileName;
// A quoted filename is incorrectly handled here, perhaps because wxExecute
// add quotes. So remove quotes if any (they also are illegal in filenames).
name.Replace( "\"", "" );
args[i++] = name.wc_str();
}
args[i] = nullptr;