diff options
-rw-r--r-- | shell/source/win32/SysShExec.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 6948ee34b490..00384b8bd235 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -302,6 +302,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa static_cast< XSystemShellExecute* >( this ), 3 ); + OUString preprocessed_command(aCommand); if ((nFlags & URIS_ONLY) != 0) { css::uno::Reference< css::uri::XUriReference > uri( @@ -315,8 +316,10 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa static_cast< cppu::OWeakObject * >(this), 0); } if (uri->getScheme().equalsIgnoreAsciiCase("file")) { + // ShellExecuteExW appears to ignore the fragment of a file URL anyway, so remove it: + uri->clearFragment(); + preprocessed_command = uri->getUriReference(); OUString pathname; - uri->clearFragment(); // getSystemPathFromFileURL fails for URLs with fragment auto const e1 = osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname); if (e1 != osl::FileBase::E_None) { @@ -439,7 +442,6 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa and names no existing file (remember the jump mark sign '#' is a valid file name character we remove the jump mark, else ShellExecuteEx fails */ - OUString preprocessed_command(aCommand); if (is_system_path(preprocessed_command)) { if (has_jump_mark(preprocessed_command) && !is_existing_file(preprocessed_command)) |