From 57d4c90055e9a2e5af11311a3bd1461884a24907 Mon Sep 17 00:00:00 2001 From: Simon Wells Date: Thu, 31 Dec 2015 23:16:26 +1300 Subject: [PATCH] Fixed bug with a text editor with a space in the name on OSX --- common/gestfich.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/gestfich.cpp b/common/gestfich.cpp index 0c34f4e25f..da224f3262 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -44,10 +44,10 @@ void AddDelimiterString( wxString& string ) { - if ( string.length() > 0 && !string.StartsWith( wxT( "\"" ) ) ) + if ( !string.StartsWith( wxT( "\"" ) ) ) { - string.Prepend( "\"" ); - string.Append( "\"" ); + string.Prepend ( wxT( "\"" ) ); + string.Append ( wxT( "\"" ) ); } } @@ -221,6 +221,8 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para #ifdef __WXMAC__ else { + AddDelimiterString( fullFileName ); + if( !param.IsEmpty() ) fullFileName += wxT( " " ) + param; @@ -341,16 +343,17 @@ wxString KicadDatasPath() } -bool OpenPDF( const wxString& filename ) +bool OpenPDF( const wxString& file ) { wxString command; + wxString filename = file; Pgm().ReadPdfBrowserInfos(); if( !Pgm().UseSystemPdfBrowser() ) // Run the preferred PDF Browser { AddDelimiterString( filename ); - command = AddDelimiterString( Pgm().GetPdfBrowserName() ) + wxT( " " ) + filename; + command = Pgm().GetPdfBrowserName() + wxT( " " ) + filename; } else {