kiplatform: Add quotes to restart registration command line.

(cherry picked from commit 6e0d940b98)
This commit is contained in:
Alex 2022-10-05 20:30:46 +03:00
parent 152252c685
commit 00ff5baf59
1 changed files with 5 additions and 2 deletions

View File

@ -83,15 +83,18 @@ bool KIPLATFORM::APP::IsOperatingSystemUnsupported()
bool KIPLATFORM::APP::RegisterApplicationRestart( const wxString& aCommandLine ) bool KIPLATFORM::APP::RegisterApplicationRestart( const wxString& aCommandLine )
{ {
// Command line arguments with spaces require quotes.
wxString restartCmd = wxS( "\"" ) + aCommandLine + wxS( "\"" );
// Ensure we don't exceed the maximum allowable size // Ensure we don't exceed the maximum allowable size
if( aCommandLine.length() > RESTART_MAX_CMD_LINE - 1 ) if( restartCmd.length() > RESTART_MAX_CMD_LINE - 1 )
{ {
return false; return false;
} }
HRESULT hr = S_OK; HRESULT hr = S_OK;
hr = ::RegisterApplicationRestart( aCommandLine.wc_str(), RESTART_NO_PATCH ); hr = ::RegisterApplicationRestart( restartCmd.wc_str(), RESTART_NO_PATCH );
return SUCCEEDED( hr ); return SUCCEEDED( hr );
} }