diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/ar.c | 2 | ||||
-rw-r--r-- | archival/cpio.c | 2 | ||||
-rw-r--r-- | archival/dpkg.c | 14 | ||||
-rw-r--r-- | archival/dpkg_deb.c | 12 | ||||
-rw-r--r-- | archival/libunarchive/Makefile.in | 1 | ||||
-rw-r--r-- | archival/libunarchive/add_to_list.c | 15 | ||||
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 2 | ||||
-rw-r--r-- | archival/tar.c | 6 | ||||
-rw-r--r-- | archival/unzip.c | 2 |
9 files changed, 20 insertions, 36 deletions
diff --git a/archival/ar.c b/archival/ar.c index 71cde4ebe..87968f7be 100644 --- a/archival/ar.c +++ b/archival/ar.c | |||
@@ -124,7 +124,7 @@ extern int ar_main(int argc, char **argv) | |||
124 | /* TODO: This is the same as in tar, seperate function ? */ | 124 | /* TODO: This is the same as in tar, seperate function ? */ |
125 | while (optind < argc) { | 125 | while (optind < argc) { |
126 | archive_handle->filter = filter_accept_list; | 126 | archive_handle->filter = filter_accept_list; |
127 | archive_handle->accept = add_to_list(archive_handle->accept, argv[optind]); | 127 | archive_handle->accept = llist_add_to(archive_handle->accept, argv[optind]); |
128 | optind++; | 128 | optind++; |
129 | } | 129 | } |
130 | 130 | ||
diff --git a/archival/cpio.c b/archival/cpio.c index 2aa11943e..8b4cc2d3e 100644 --- a/archival/cpio.c +++ b/archival/cpio.c | |||
@@ -79,7 +79,7 @@ extern int cpio_main(int argc, char **argv) | |||
79 | 79 | ||
80 | while (optind < argc) { | 80 | while (optind < argc) { |
81 | archive_handle->filter = filter_accept_list; | 81 | archive_handle->filter = filter_accept_list; |
82 | archive_handle->accept = add_to_list(archive_handle->accept, argv[optind]); | 82 | archive_handle->accept = llist_add_to(archive_handle->accept, argv[optind]); |
83 | optind++; | 83 | optind++; |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/archival/dpkg.c b/archival/dpkg.c index 274d711dc..d3e652bc8 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1330,10 +1330,10 @@ static void init_archive_deb_control(archive_handle_t *ar_handle) | |||
1330 | 1330 | ||
1331 | /* We dont care about data.tar.* or debian-binary, just control.tar.* */ | 1331 | /* We dont care about data.tar.* or debian-binary, just control.tar.* */ |
1332 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ | 1332 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ |
1333 | ar_handle->accept = add_to_list(NULL, "control.tar.gz"); | 1333 | ar_handle->accept = llist_add_to(NULL, "control.tar.gz"); |
1334 | #endif | 1334 | #endif |
1335 | #ifdef CONFIG_FEATURE_DEB_TAR_BZ2 | 1335 | #ifdef CONFIG_FEATURE_DEB_TAR_BZ2 |
1336 | ar_handle->accept = add_to_list(ar_handle->accept, "control.tar.bz2"); | 1336 | ar_handle->accept = llist_add_to(ar_handle->accept, "control.tar.bz2"); |
1337 | #endif | 1337 | #endif |
1338 | 1338 | ||
1339 | /* Assign the tar handle as a subarchive of the ar handle */ | 1339 | /* Assign the tar handle as a subarchive of the ar handle */ |
@@ -1353,10 +1353,10 @@ static void init_archive_deb_data(archive_handle_t *ar_handle) | |||
1353 | 1353 | ||
1354 | /* We dont care about data.tar.* or debian-binary, just control.tar.* */ | 1354 | /* We dont care about data.tar.* or debian-binary, just control.tar.* */ |
1355 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ | 1355 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ |
1356 | tar_handle->accept = add_to_list(NULL, "data.tar.gz"); | 1356 | tar_handle->accept = llist_add_to(NULL, "data.tar.gz"); |
1357 | #endif | 1357 | #endif |
1358 | #ifdef CONFIG_FEATURE_DEB_TAR_BZ2 | 1358 | #ifdef CONFIG_FEATURE_DEB_TAR_BZ2 |
1359 | tar_handle->accept = add_to_list(ar_handle->accept, "data.tar.bz2"); | 1359 | tar_handle->accept = llist_add_to(ar_handle->accept, "data.tar.bz2"); |
1360 | #endif | 1360 | #endif |
1361 | 1361 | ||
1362 | /* Assign the tar handle as a subarchive of the ar handle */ | 1362 | /* Assign the tar handle as a subarchive of the ar handle */ |
@@ -1365,7 +1365,7 @@ static void init_archive_deb_data(archive_handle_t *ar_handle) | |||
1365 | return; | 1365 | return; |
1366 | } | 1366 | } |
1367 | 1367 | ||
1368 | static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, const llist_t *accept) | 1368 | static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, llist_t *accept) |
1369 | { | 1369 | { |
1370 | ar_handle->sub_archive->action_data = data_extract_to_buffer; | 1370 | ar_handle->sub_archive->action_data = data_extract_to_buffer; |
1371 | ar_handle->sub_archive->accept = accept; | 1371 | ar_handle->sub_archive->accept = accept; |
@@ -1532,10 +1532,10 @@ int dpkg_main(int argc, char **argv) | |||
1532 | deb_file[deb_count] = (deb_file_t *) xmalloc(sizeof(deb_file_t)); | 1532 | deb_file[deb_count] = (deb_file_t *) xmalloc(sizeof(deb_file_t)); |
1533 | if (dpkg_opt & dpkg_opt_filename) { | 1533 | if (dpkg_opt & dpkg_opt_filename) { |
1534 | archive_handle_t *archive_handle; | 1534 | archive_handle_t *archive_handle; |
1535 | const llist_t *control_list = NULL; | 1535 | llist_t *control_list = NULL; |
1536 | 1536 | ||
1537 | /* Extract the control file */ | 1537 | /* Extract the control file */ |
1538 | control_list = add_to_list(NULL, "./control"); | 1538 | control_list = llist_add_to(NULL, "./control"); |
1539 | archive_handle = init_archive_deb_ar(argv[optind]); | 1539 | archive_handle = init_archive_deb_ar(argv[optind]); |
1540 | init_archive_deb_control(archive_handle); | 1540 | init_archive_deb_control(archive_handle); |
1541 | deb_file[deb_count]->control_file = deb_extract_control_file_to_buffer(archive_handle, control_list); | 1541 | 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 7ce637e5e..2c338227c 100644 --- a/archival/dpkg_deb.c +++ b/archival/dpkg_deb.c | |||
@@ -27,7 +27,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
27 | archive_handle_t *tar_archive; | 27 | archive_handle_t *tar_archive; |
28 | int opt = 0; | 28 | int opt = 0; |
29 | #ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY | 29 | #ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY |
30 | const llist_t *control_tar_llist = NULL; | 30 | llist_t *control_tar_llist = NULL; |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | /* Setup the tar archive handle */ | 33 | /* Setup the tar archive handle */ |
@@ -39,16 +39,16 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
39 | ar_archive->filter = filter_accept_list_reassign; | 39 | ar_archive->filter = filter_accept_list_reassign; |
40 | 40 | ||
41 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ | 41 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ |
42 | ar_archive->accept = add_to_list(NULL, "data.tar.gz"); | 42 | ar_archive->accept = llist_add_to(NULL, "data.tar.gz"); |
43 | # ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY | 43 | # ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY |
44 | control_tar_llist = add_to_list(NULL, "control.tar.gz"); | 44 | control_tar_llist = llist_add_to(NULL, "control.tar.gz"); |
45 | # endif | 45 | # endif |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #ifdef CONFIG_FEATURE_DEB_TAR_BZ2 | 48 | #ifdef CONFIG_FEATURE_DEB_TAR_BZ2 |
49 | ar_archive->accept = add_to_list(ar_archive->accept, "data.tar.bz2"); | 49 | ar_archive->accept = llist_add_to(ar_archive->accept, "data.tar.bz2"); |
50 | # ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY | 50 | # ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY |
51 | control_tar_llist = add_to_list(control_tar_llist, "control.tar.bz2"); | 51 | control_tar_llist = llist_add_to(control_tar_llist, "control.tar.bz2"); |
52 | # endif | 52 | # endif |
53 | #endif | 53 | #endif |
54 | 54 | ||
@@ -71,7 +71,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
71 | * it should accept a second argument which specifies a | 71 | * it should accept a second argument which specifies a |
72 | * specific field to print */ | 72 | * specific field to print */ |
73 | ar_archive->accept = control_tar_llist; | 73 | ar_archive->accept = control_tar_llist; |
74 | tar_archive->accept = add_to_list(NULL, "./control");; | 74 | tar_archive->accept = llist_add_to(NULL, "./control");; |
75 | tar_archive->filter = filter_accept_list; | 75 | tar_archive->filter = filter_accept_list; |
76 | tar_archive->action_data = data_extract_to_stdout; | 76 | tar_archive->action_data = data_extract_to_stdout; |
77 | break; | 77 | break; |
diff --git a/archival/libunarchive/Makefile.in b/archival/libunarchive/Makefile.in index 5675d092f..28e2955b9 100644 --- a/archival/libunarchive/Makefile.in +++ b/archival/libunarchive/Makefile.in | |||
@@ -53,7 +53,6 @@ LIBUNARCHIVE-y:= \ | |||
53 | \ | 53 | \ |
54 | archive_copy_file.o \ | 54 | archive_copy_file.o \ |
55 | \ | 55 | \ |
56 | add_to_list.o \ | ||
57 | check_header_gzip.o \ | 56 | check_header_gzip.o \ |
58 | check_trailer_gzip.o \ | 57 | check_trailer_gzip.o \ |
59 | data_align.o \ | 58 | data_align.o \ |
diff --git a/archival/libunarchive/add_to_list.c b/archival/libunarchive/add_to_list.c deleted file mode 100644 index 052bca351..000000000 --- a/archival/libunarchive/add_to_list.c +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #include <stdlib.h> | ||
2 | #include <string.h> | ||
3 | #include "unarchive.h" | ||
4 | #include "libbb.h" | ||
5 | |||
6 | extern const llist_t *add_to_list(const llist_t *old_head, const char *new_item) | ||
7 | { | ||
8 | llist_t *new_head; | ||
9 | |||
10 | new_head = xmalloc(sizeof(llist_t)); | ||
11 | new_head->data = new_item; | ||
12 | new_head->link = old_head; | ||
13 | |||
14 | return(new_head); | ||
15 | } | ||
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index 37e33d4c3..5fed7c1bf 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c | |||
@@ -171,7 +171,7 @@ extern char get_header_tar(archive_handle_t *archive_handle) | |||
171 | archive_handle->action_header(archive_handle->file_header); | 171 | archive_handle->action_header(archive_handle->file_header); |
172 | archive_handle->flags |= ARCHIVE_EXTRACT_QUIET; | 172 | archive_handle->flags |= ARCHIVE_EXTRACT_QUIET; |
173 | archive_handle->action_data(archive_handle); | 173 | archive_handle->action_data(archive_handle); |
174 | archive_handle->passed = add_to_list(archive_handle->passed, archive_handle->file_header->name); | 174 | archive_handle->passed = llist_add_to(archive_handle->passed, archive_handle->file_header->name); |
175 | } else { | 175 | } else { |
176 | data_skip(archive_handle); | 176 | data_skip(archive_handle); |
177 | } | 177 | } |
diff --git a/archival/tar.c b/archival/tar.c index 1899ab954..fa1c57512 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -583,13 +583,13 @@ static inline int writeTarFile(const char *tarName, const int verboseFlag, | |||
583 | #endif /* tar_create */ | 583 | #endif /* tar_create */ |
584 | 584 | ||
585 | #ifdef CONFIG_FEATURE_TAR_EXCLUDE | 585 | #ifdef CONFIG_FEATURE_TAR_EXCLUDE |
586 | static const llist_t *append_file_list_to_list(const char *filename, const llist_t *list) | 586 | static llist_t *append_file_list_to_list(const char *filename, llist_t *list) |
587 | { | 587 | { |
588 | FILE *src_stream = xfopen(filename, "r"); | 588 | FILE *src_stream = xfopen(filename, "r"); |
589 | char *line; | 589 | char *line; |
590 | while((line = get_line_from_file(src_stream)) != NULL) { | 590 | while((line = get_line_from_file(src_stream)) != NULL) { |
591 | chomp(line); | 591 | chomp(line); |
592 | list = add_to_list(list, line); | 592 | list = llist_add_to(list, line); |
593 | } | 593 | } |
594 | fclose(src_stream); | 594 | fclose(src_stream); |
595 | 595 | ||
@@ -708,7 +708,7 @@ int tar_main(int argc, char **argv) | |||
708 | /* Setup an array of filenames to work with */ | 708 | /* Setup an array of filenames to work with */ |
709 | /* TODO: This is the same as in ar, seperate function ? */ | 709 | /* TODO: This is the same as in ar, seperate function ? */ |
710 | while (optind < argc) { | 710 | while (optind < argc) { |
711 | tar_handle->accept = add_to_list(tar_handle->accept, argv[optind]); | 711 | tar_handle->accept = llist_add_to(tar_handle->accept, argv[optind]); |
712 | optind++; | 712 | optind++; |
713 | } | 713 | } |
714 | 714 | ||
diff --git a/archival/unzip.c b/archival/unzip.c index 4c1e5ce40..86416d327 100644 --- a/archival/unzip.c +++ b/archival/unzip.c | |||
@@ -147,7 +147,7 @@ extern int unzip_main(int argc, char **argv) | |||
147 | 147 | ||
148 | while (optind < argc) { | 148 | while (optind < argc) { |
149 | archive_handle->filter = filter_accept_list; | 149 | archive_handle->filter = filter_accept_list; |
150 | archive_handle->accept = add_to_list(archive_handle->accept, argv[optind]); | 150 | archive_handle->accept = llist_add_to(archive_handle->accept, argv[optind]); |
151 | optind++; | 151 | optind++; |
152 | } | 152 | } |
153 | 153 | ||