]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge pull request #2969 from stoeckmann/glibc234
authorTim Kientzle <kientzle@acm.org>
Sat, 9 May 2026 15:58:28 +0000 (08:58 -0700)
committerMartin Matuska <martin@matuska.de>
Tue, 23 Jun 2026 08:27:12 +0000 (10:27 +0200)
Fix build with glibc 2.43

(cherry picked from commit 3f7a0040557683533ba0c36952b83e21b78c3f7f)

libarchive/archive_options.c
libarchive/archive_pack_dev.c
libarchive/archive_read_support_format_mtree.c
libarchive/archive_read_support_format_tar.c
libarchive/archive_write_set_format_iso9660.c
libarchive/archive_write_set_format_mtree.c
libarchive/archive_write_set_format_warc.c
libarchive/archive_write_set_format_xar.c
libarchive/test/test_write_format_mtree.c
tar/bsdtar.h

index 66491bd4183bac2f7c9d85cd438bf00eecfedf18..6190bb8ef7ee3ef89d42c340878a10c06b10b045 100644 (file)
@@ -31,9 +31,9 @@
 
 #include "archive_options_private.h"
 
-static const char *
-parse_option(const char **str,
-    const char **mod, const char **opt, const char **val);
+static char *
+parse_option(char **str,
+    char **mod, char **opt, char **val);
 
 int
 _archive_set_option(struct archive *a,
@@ -103,7 +103,7 @@ _archive_set_options(struct archive *a, const char *options,
 {
        int allok = 1, anyok = 0, ignore_mod_err = 0, r;
        char *data;
-       const char *s, *mod, *opt, *val;
+       char *s, *mod, *opt, *val;
 
        archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn);
 
@@ -115,7 +115,7 @@ _archive_set_options(struct archive *a, const char *options,
                    ENOMEM, "Out of memory adding file to list");
                return (ARCHIVE_FATAL);
        }
-       s = (const char *)data;
+       s = data;
 
        do {
                mod = opt = val = NULL;
@@ -167,10 +167,10 @@ _archive_set_options(struct archive *a, const char *options,
        return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
 }
 
-static const char *
-parse_option(const char **s, const char **m, const char **o, const char **v)
+static char *
+parse_option(char **s, char **m, char **o, char **v)
 {
-       const char *end, *mod, *opt, *val;
+       char *end, *mod, *opt, *val;
        char *p;
 
        end = NULL;
@@ -182,7 +182,7 @@ parse_option(const char **s, const char **m, const char **o, const char **v)
 
        if (p != NULL) {
                *p = '\0';
-               end = ((const char *)p) + 1;
+               end = p + 1;
        }
 
        if (0 == strlen(opt)) {
index 3c6209b9840560d7fb4e6cecf65780042802eee3..e29351292895a7a3d2d5e04e0e361cea0f671f84 100644 (file)
@@ -319,7 +319,7 @@ compare_format(const void *key, const void *element)
 pack_t *
 pack_find(const char *name)
 {
-       struct format   *format;
+       const struct format     *format;
 
        format = bsearch(name, formats,
            sizeof(formats)/sizeof(formats[0]),
index 4a5a49ca813635c7113a30595838a4487ebff473..7a13c8e6e82511482bf77a71a13dd1f0948f0675 100644 (file)
@@ -2100,8 +2100,7 @@ readline(struct archive_read *a, struct mtree *mtree, char **start,
        ssize_t bytes_read;
        ssize_t total_size = 0;
        ssize_t find_off = 0;
-       const void *t;
-       void *nl;
+       const void *nl, *t;
        char *u;
 
        /* Accumulate line in a line buffer. */
index a16f4c064776048e8d30a360f0d768b360c156fe..dadc8370842d99971d9755c805dd3490ac799057 100644 (file)
@@ -3636,9 +3636,8 @@ readline(struct archive_read *a, struct tar *tar, const char **start,
 {
        ssize_t bytes_read;
        ssize_t total_size = 0;
-       const void *t;
+       const void *p, *t;
        const char *s;
-       void *p;
 
        if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
                return (ARCHIVE_FATAL);
index 576b3ba52b0c7506b3e5bdc453dded1a5ff18fee..eee9f2c75aec7bbf98f70a083eb0c79ce5e5b849 100644 (file)
@@ -5537,7 +5537,7 @@ isoent_setup_file_location(struct iso9660 *iso9660, int location)
 static int
 get_path_component(char *name, size_t n, const char *fn)
 {
-       char *p;
+       const char *p;
        size_t l;
 
        p = strchr(fn, '/');
index 36e00191c8c76afdae3dbe59307ac3ffd5b3e3e3..0a00a3550bbd2d55c6b01bbd3d8d9f8f8311b781 100644 (file)
@@ -2039,7 +2039,7 @@ mtree_entry_find_child(struct mtree_entry *parent, const char *child_name)
 static int
 get_path_component(char *name, size_t n, const char *fn)
 {
-       char *p;
+       const char *p;
        size_t l;
 
        p = strchr(fn, '/');
index 3d22e1f4ba57f58cdd41a0b0b11fb3516df59416..5a0ca0b5261108c008bd2f11caa1912169bec292 100644 (file)
@@ -371,7 +371,7 @@ _popul_ehdr(struct archive_string *tgt, size_t tsz, warc_essential_hdr_t hdr)
                static const char _uri[] = "";
                static const char _fil[] = "file://";
                const char *u;
-               char *chk = strchr(hdr.tgturi, ':');
+               const char *chk = strchr(hdr.tgturi, ':');
 
                if (chk != NULL && chk[1U] == '/' && chk[2U] == '/') {
                        /* yep, it's definitely a URI */
index eb676e94726dbf91dc0a557a03e7ccd30ded3065..e7281d0b5965cae6c0d854b0106d23b748447d6a 100644 (file)
@@ -2272,7 +2272,7 @@ file_gen_utility_names(struct archive_write *a, struct file *file)
 static int
 get_path_component(char *name, int n, const char *fn)
 {
-       char *p;
+       const char *p;
        int l;
 
        p = strchr(fn, '/');
index ed065f9c13400287d50eabdcd239fc93eabf3cb9..907e291f2f55a083350f075a867524d7f57d2abe 100644 (file)
@@ -109,7 +109,7 @@ test_write_format_mtree_sub(int use_set, int dironly)
         assertEqualInt(ARCHIVE_OK, archive_write_free(a));
 
        if (use_set) {
-               const char *p;
+               char *p;
 
                buff[used] = '\0';
                assert(NULL != (p = strstr(buff, "\n/set ")));
@@ -197,7 +197,7 @@ test_write_format_mtree_sub2(int use_set, int dironly)
         assertEqualInt(ARCHIVE_OK, archive_write_free(a));
 
   if (use_set) {
-    const char *p;
+    char *p;
 
     buff[used] = '\0';
     assert(NULL != (p = strstr(buff, "\n/set ")));
index 782d36d6f75620f1bf1ae2f725417d9e48093aaf..692b800bf811b29361b925212c92419da03799bd 100644 (file)
@@ -67,7 +67,7 @@ struct bsdtar {
        /* Miscellaneous state information */
        int               argc;
        char            **argv;
-       const char       *argument;
+       char             *argument;
        size_t            gs_width; /* For 'list_item' in read.c */
        size_t            u_width; /* for 'list_item' in read.c */
        uid_t             user_uid; /* UID running this program */