[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - shell/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 7 17:30:49 UTC 2020


 shell/source/win32/SysShExec.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit f565bf2385636c005637bc00bdb8eae8ebbae176
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jan 15 17:16:02 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Fri Feb 7 18:30:21 2020 +0100

    Remove a fragment from a file URL early on
    
    ...as ShellExecuteExW would ignore it anyway
    
    Change-Id: I969db094bb7d2ea230ac8c36eb23d71a90fbe466
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86868
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 14b36a16b225bf7c988f118d499a7287c47cd83e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86877
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 51da0d22ff42b20ab38130b7874651ef136ecceb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88207
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Tested-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 8a926214ba59..0b2f7895dbe1 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -276,6 +276,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(
@@ -289,8 +290,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) {
@@ -394,7 +397,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))


More information about the Libreoffice-commits mailing list