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>
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index a335701..ec64b5d 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 8c3d284..7b86fe0 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
            {