diff options
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | build/cmake/FindLIBGCC.cmake (renamed from build/cmake/FindLibGCC.cmake) | 0 | ||||
-rw-r--r-- | libarchive/archive_entry.c | 14 | ||||
-rw-r--r-- | libarchive/archive_write_disk_windows.c | 3 | ||||
-rw-r--r-- | libarchive/test/test_archive_string_conversion.c | 1 | ||||
-rw-r--r-- | tar/subst.c | 1 |
6 files changed, 23 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e3bb6591..1130b8c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,7 +213,7 @@ OPTION(ENABLE_BZip2 "Enable the use of the system BZip2 library if found" ON) OPTION(ENABLE_LIBXML2 "Enable the use of the system libxml2 library if found" ON) OPTION(ENABLE_EXPAT "Enable the use of the system EXPAT library if found" ON) OPTION(ENABLE_PCREPOSIX "Enable the use of the system PCREPOSIX library if found" ON) -OPTION(ENABLE_LibGCC "Enable the use of the system LibGCC library if found" ON) +OPTION(ENABLE_LIBGCC "Enable the use of the system LibGCC library if found" ON) # CNG is used for encrypt/decrypt Zip archives on Windows. OPTION(ENABLE_CNG "Enable the use of CNG(Crypto Next Generation)" ON) @@ -1264,9 +1264,10 @@ IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$" # # If requested, try finding library for PCREPOSIX # - IF(ENABLE_LibGCC) - FIND_PACKAGE(LibGCC) + IF(ENABLE_LIBGCC) + FIND_PACKAGE(LIBGCC) ELSE() + MESSAGE(FATAL_ERROR "libgcc not found.") SET(LIBGCC_FOUND FALSE) # Override cached value ENDIF() IF(ENABLE_PCREPOSIX) diff --git a/build/cmake/FindLibGCC.cmake b/build/cmake/FindLIBGCC.cmake index 5883ff80..5883ff80 100644 --- a/build/cmake/FindLibGCC.cmake +++ b/build/cmake/FindLIBGCC.cmake diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c index ca7a4bdb..ae6dc333 100644 --- a/libarchive/archive_entry.c +++ b/libarchive/archive_entry.c @@ -568,6 +568,13 @@ archive_entry_nlink(struct archive_entry *entry) return (entry->ae_stat.aest_nlink); } +/* Instead, our caller could have chosen a specific encoding + * (archive_mstring_get_mbs, archive_mstring_get_utf8, + * archive_mstring_get_wcs). So we should try multiple + * encodings. Try mbs first because of history, even though + * utf8 might be better for pathname portability. + * Also omit wcs because of type mismatch (char * versus wchar *) + */ const char * archive_entry_pathname(struct archive_entry *entry) { @@ -575,6 +582,13 @@ archive_entry_pathname(struct archive_entry *entry) if (archive_mstring_get_mbs( entry->archive, &entry->ae_pathname, &p) == 0) return (p); +#if HAVE_EILSEQ /*{*/ + if (errno == EILSEQ) { + if (archive_mstring_get_utf8( + entry->archive, &entry->ae_pathname, &p) == 0) + return (p); + } +#endif /*}*/ if (errno == ENOMEM) __archive_errx(1, "No memory"); return (NULL); diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c index 5474de16..88df3ce0 100644 --- a/libarchive/archive_write_disk_windows.c +++ b/libarchive/archive_write_disk_windows.c @@ -2261,6 +2261,9 @@ cleanup_pathname(struct archive_write_disk *a, wchar_t *name) return (ARCHIVE_FAILED); } else p += 4; + /* Network drive path like "\\<server-name>\<share-name>\file" */ + } else if (p[0] == L'\\' && p[1] == L'\\') { + p += 2; } /* Skip leading drive letter from archives created diff --git a/libarchive/test/test_archive_string_conversion.c b/libarchive/test/test_archive_string_conversion.c index fb5359b6..7faf58bf 100644 --- a/libarchive/test/test_archive_string_conversion.c +++ b/libarchive/test/test_archive_string_conversion.c @@ -847,6 +847,7 @@ test_archive_string_set_get(void) assertEqualInt(0, archive_mstring_update_utf8(a, &mstr, "EEEEE---H")); check_string(a, &mstr, sc, "EEEEE---H", L"EEEEE---H"); + archive_mstring_clean(&mstr); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } diff --git a/tar/subst.c b/tar/subst.c index 39c54acf..55ad63dc 100644 --- a/tar/subst.c +++ b/tar/subst.c @@ -320,6 +320,7 @@ cleanup_substitution(struct bsdtar *bsdtar) while ((rule = subst->first_rule) != NULL) { subst->first_rule = rule->next; free(rule->result); + regfree(&rule->re); free(rule); } free(subst); |