diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-24 09:35:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-24 18:21:34 +0100 |
commit | efa20d38fa51675e738ce50d6894b5df75debea0 (patch) | |
tree | 297ccdfa9d8720532a7e139299fde2acb509a9bb /tools | |
parent | 15bb6eede17160a84674ce4911bd0fdcee3c7747 (diff) |
tdf#146382 cant open file from Explorer-attached remote location
problem spotted by mikekaganski
regression from
commit 0b46361ef84a61100a0274a007062317607d097a
Author: Noel Grandin <noel@peralex.com>
Date: Sat Nov 20 08:03:49 2021 +0200
tdf#133835 speedup calc autofilter (4)
where I changed the behaviour of parseHostOrNetBiosName from overwriting
the destination buffer to appending to it.
Change-Id: I1bd3c7eade035a867c026364f5e114c1e652ca32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127352
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 15bc492281111997a5da556961b923bb607642b6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127381
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_urlobj.cxx | 9 | ||||
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx index a335701c5cab..ec64b5d66777 100644 --- a/tools/qa/cppunit/test_urlobj.cxx +++ b/tools/qa/cppunit/test_urlobj.cxx @@ -311,6 +311,14 @@ namespace tools_urlobj obj.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } + void testTd146382() { + INetURLObject obj("file://share.allotropia.de@SSL/DavWWWRoot/remote.php"); + CPPUNIT_ASSERT(!obj.HasError()); + CPPUNIT_ASSERT_EQUAL( + OUString("file://share.allotropia.de@SSL/DavWWWRoot/remote.php"), + obj.GetMainURL(INetURLObject::DecodeMechanism::NONE)); + } + // Change the following lines only, if you add, remove or rename // member functions of the current class, // because these macros are need by auto register mechanism. @@ -326,6 +334,7 @@ namespace tools_urlobj CPPUNIT_TEST( testSetName ); CPPUNIT_TEST( testSetExtension ); CPPUNIT_TEST( testChangeScheme ); + CPPUNIT_TEST( testTd146382 ); CPPUNIT_TEST_SUITE_END( ); }; // class createPool diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 8c3d2845eab2..7b86fe0f5261 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -2880,7 +2880,10 @@ bool INetURLObject::parseHostOrNetBiosName( } } if (pCanonic) + { + pCanonic->setLength(nOriginalCanonicLength); pCanonic->append(buf); + } } else { |