Change llist_add_* to take the address of the list rather than returning the new
head, and change all the callers.
diff --git a/archival/ar.c b/archival/ar.c
index 7782af8..f9a6bb7 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -97,7 +97,7 @@
while (optind < argc) {
archive_handle->filter = filter_accept_list;
- archive_handle->accept = llist_add_to(archive_handle->accept, argv[optind++]);
+ llist_add_to(&(archive_handle->accept), argv[optind++]);
}
archive_xread_all(archive_handle, magic, 7);
diff --git a/archival/cpio.c b/archival/cpio.c
index 26f845b..478379c 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -88,7 +88,7 @@
while (optind < argc) {
archive_handle->filter = filter_accept_list;
- archive_handle->accept = llist_add_to(archive_handle->accept, argv[optind]);
+ llist_add_to(&(archive_handle->accept), argv[optind]);
optind++;
}
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 3621db4..2895f4f 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1484,10 +1484,10 @@
/* We don't care about data.tar.* or debian-binary, just control.tar.* */
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
- ar_handle->accept = llist_add_to(NULL, "control.tar.gz");
+ llist_add_to(&(ar_handle->accept), "control.tar.gz");
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
- ar_handle->accept = llist_add_to(ar_handle->accept, "control.tar.bz2");
+ llist_add_to(&(ar_handle->accept), "control.tar.bz2");
#endif
/* Assign the tar handle as a subarchive of the ar handle */
@@ -1506,10 +1506,10 @@
/* We don't care about control.tar.* or debian-binary, just data.tar.* */
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
- ar_handle->accept = llist_add_to(NULL, "data.tar.gz");
+ llist_add_to(&(ar_handle->accept), "data.tar.gz");
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
- ar_handle->accept = llist_add_to(ar_handle->accept, "data.tar.bz2");
+ llist_add_to(&(ar_handle->accept), "data.tar.bz2");
#endif
/* Assign the tar handle as a subarchive of the ar handle */
@@ -1575,7 +1575,7 @@
while(all_control_files[i]) {
char *c = (char *) xmalloc(3 + strlen(all_control_files[i]));
sprintf(c, "./%s", all_control_files[i]);
- accept_list= llist_add_to(accept_list, c);
+ llist_add_to(&accept_list, c);
i++;
}
archive_handle->sub_archive->accept = accept_list;
@@ -1705,7 +1705,7 @@
llist_t *control_list = NULL;
/* Extract the control file */
- control_list = llist_add_to(NULL, "./control");
+ llist_add_to(&control_list, "./control");
archive_handle = init_archive_deb_ar(argv[optind]);
init_archive_deb_control(archive_handle);
deb_file[deb_count]->control_file = deb_extract_control_file_to_buffer(archive_handle, control_list);
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index fc8b922..b99f227 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -36,13 +36,13 @@
ar_archive->filter = filter_accept_list_reassign;
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
- ar_archive->accept = llist_add_to(NULL, "data.tar.gz");
- control_tar_llist = llist_add_to(NULL, "control.tar.gz");
+ llist_add_to(&(ar_archive->accept), "data.tar.gz");
+ llist_add_to(&control_tar_llist, "control.tar.gz");
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
- ar_archive->accept = llist_add_to(ar_archive->accept, "data.tar.bz2");
- control_tar_llist = llist_add_to(control_tar_llist, "control.tar.bz2");
+ llist_add_to(&(ar_archive->accept), "data.tar.bz2");
+ llist_add_to(&control_tar_llist, "control.tar.bz2");
#endif
bb_opt_complementally = "?c--efXx:e--cfXx:f--ceXx:X--cefx:x--cefX";
@@ -65,7 +65,7 @@
* it should accept a second argument which specifies a
* specific field to print */
ar_archive->accept = control_tar_llist;
- tar_archive->accept = llist_add_to(NULL, "./control");
+ llist_add_to(&(tar_archive->accept), "./control");
tar_archive->filter = filter_accept_list;
tar_archive->action_data = data_extract_to_stdout;
}
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index cd38f45..c9308f9 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -206,7 +206,7 @@
archive_handle->action_header(archive_handle->file_header);
archive_handle->flags |= ARCHIVE_EXTRACT_QUIET;
archive_handle->action_data(archive_handle);
- archive_handle->passed = llist_add_to(archive_handle->passed, file_header->name);
+ llist_add_to(&(archive_handle->passed), file_header->name);
} else {
data_skip(archive_handle);
}
diff --git a/archival/libunarchive/init_handle.c b/archival/libunarchive/init_handle.c
index 3cee84f..1813131 100644
--- a/archival/libunarchive/init_handle.c
+++ b/archival/libunarchive/init_handle.c
@@ -24,8 +24,7 @@
archive_handle_t *archive_handle;
/* Initialise default values */
- archive_handle = xmalloc(sizeof(archive_handle_t));
- memset(archive_handle, 0, sizeof(archive_handle_t));
+ archive_handle = xzalloc(sizeof(archive_handle_t));
archive_handle->file_header = xmalloc(sizeof(file_header_t));
archive_handle->action_header = header_skip;
archive_handle->action_data = data_skip;
diff --git a/archival/tar.c b/archival/tar.c
index e4008b0..f3594f6 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -551,7 +551,7 @@
cur = cur->link;
free(tmp);
while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL)
- newlist = llist_add_to(newlist, line);
+ llist_add_to(&newlist, line);
fclose(src_stream);
}
return newlist;
@@ -800,7 +800,7 @@
if (filename_ptr > argv[optind])
*filename_ptr = '\0';
- tar_handle->accept = llist_add_to(tar_handle->accept, argv[optind]);
+ llist_add_to(&(tar_handle->accept), argv[optind]);
optind++;
}
diff --git a/archival/unzip.c b/archival/unzip.c
index 2cb256c..0b1e6f9 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -180,7 +180,7 @@
case 1: /* Include files */
if (opt == 1) {
- zaccept = llist_add_to(zaccept, optarg);
+ llist_add_to(&zaccept, optarg);
} else if (opt == 'd') {
base_dir = optarg;
@@ -196,7 +196,7 @@
case 2 : /* Exclude files */
if (opt == 1) {
- zreject = llist_add_to(zreject, optarg);
+ llist_add_to(&zreject, optarg);
} else if (opt == 'd') { /* Extract to base directory */
base_dir = optarg;