]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix full-pathname for extraction with unc working directory on windows 1083/head
authorGuido Schulz <guido.schulz@mettenmeier.de>
Wed, 7 Nov 2018 16:25:58 +0000 (17:25 +0100)
committerGuido Schulz <guido.schulz@mettenmeier.de>
Sun, 18 Nov 2018 08:19:57 +0000 (09:19 +0100)
Fix full-pathname for extraction with unc working directory on windows

libarchive/archive_write_disk_windows.c

index 78eda4abc8d1bde5f9c03b9c007b66f858fb9387..a68db6e2b67502c8939f5b83de3dfb814ddb0cd1 100644 (file)
@@ -474,6 +474,11 @@ permissive_name_w(struct archive_write_disk *a)
        {
                archive_wstrncpy(&(a->_name_data), wsp, l);
        }
+       else if (l > 2 && wsp[0] == L'\\' && wsp[1] == L'\\' && wsp[2] != L'\\')
+       {
+               archive_wstrncpy(&(a->_name_data), L"\\\\?\\UNC\\", 8);
+               archive_wstrncat(&(a->_name_data), wsp+2, l-2);
+       }
        else
        {
                archive_wstrncpy(&(a->_name_data), L"\\\\?\\", 4);