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-- | tar/subst.c | 1 |
4 files changed, 19 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/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); |