From: Michihiro NAKAJIMA Date: Sat, 6 Oct 2012 07:21:45 +0000 (+0900) Subject: Remove __archive_read_program(), use __archive_read_programl() instead. X-Git-Tag: v3.1.0~40^2~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41df162791f980e992f77b1a2335f773568b70bf;p=thirdparty%2Flibarchive.git Remove __archive_read_program(), use __archive_read_programl() instead. --- diff --git a/libarchive/archive_read_private.h b/libarchive/archive_read_private.h index 03a7733f1..9f580c94d 100644 --- a/libarchive/archive_read_private.h +++ b/libarchive/archive_read_private.h @@ -225,7 +225,6 @@ int64_t __archive_read_seek(struct archive_read*, int64_t, int); int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); -int __archive_read_program(struct archive_read_filter *, const char *); int __archive_read_programl(struct archive_read_filter *, const char *, const char *, .../*, (char *)0 */); int __archive_read_programv(struct archive_read_filter *, const char *, diff --git a/libarchive/archive_read_support_filter_bzip2.c b/libarchive/archive_read_support_filter_bzip2.c index 8d5bd1c4a..96647ee2a 100644 --- a/libarchive/archive_read_support_filter_bzip2.c +++ b/libarchive/archive_read_support_filter_bzip2.c @@ -170,8 +170,8 @@ bzip2_reader_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "bunzip2"); - /* Note: We set the format here even if __archive_read_program() + r = __archive_read_programl(self, "bunzip2", "bunzip2", NULL); + /* Note: We set the format here even if __archive_read_programl() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ self->code = ARCHIVE_COMPRESSION_BZIP2; diff --git a/libarchive/archive_read_support_filter_gzip.c b/libarchive/archive_read_support_filter_gzip.c index b98ccf6f9..c0feb8aa9 100644 --- a/libarchive/archive_read_support_filter_gzip.c +++ b/libarchive/archive_read_support_filter_gzip.c @@ -232,7 +232,7 @@ gzip_bidder_init(struct archive_read_filter *self) int r; r = __archive_read_programl(self, "gzip", "gzip", "-d", NULL); - /* Note: We set the format here even if __archive_read_program() + /* Note: We set the format here even if __archive_read_programl() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ self->code = ARCHIVE_COMPRESSION_GZIP; diff --git a/libarchive/archive_read_support_filter_lrzip.c b/libarchive/archive_read_support_filter_lrzip.c index c61076f24..d0cf31de7 100644 --- a/libarchive/archive_read_support_filter_lrzip.c +++ b/libarchive/archive_read_support_filter_lrzip.c @@ -118,7 +118,7 @@ lrzip_bidder_init(struct archive_read_filter *self) int r; r = __archive_read_programl(self, "lrzip", "lrzip", "-q", "-d", NULL); - /* Note: We set the format here even if __archive_read_program() + /* Note: We set the format here even if __archive_read_programl() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ self->code = ARCHIVE_COMPRESSION_LRZIP; diff --git a/libarchive/archive_read_support_filter_program.c b/libarchive/archive_read_support_filter_program.c index ae6f3990d..5b052d7cb 100644 --- a/libarchive/archive_read_support_filter_program.c +++ b/libarchive/archive_read_support_filter_program.c @@ -578,24 +578,6 @@ child_read(struct archive_read_filter *self, char *buf, size_t buf_len) } } -int -__archive_read_program(struct archive_read_filter *self, const char *cmd) -{ - char *argv[2]; - int r; - - argv[0] = strdup(cmd); - if (argv[0] == NULL) { - archive_set_error(&self->archive->archive, ENOMEM, - "Can't allocate input data"); - return (ARCHIVE_FATAL); - } - argv[1] = NULL; - r = __archive_read_programv(self, cmd, argv); - free(argv[0]); - return (r); -} - int __archive_read_programl(struct archive_read_filter *self, const char *cmd, const char *arg, ...) diff --git a/libarchive/archive_read_support_filter_xz.c b/libarchive/archive_read_support_filter_xz.c index cf762a46d..baf318840 100644 --- a/libarchive/archive_read_support_filter_xz.c +++ b/libarchive/archive_read_support_filter_xz.c @@ -941,8 +941,8 @@ lzma_bidder_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "unlzma"); - /* Note: We set the format here even if __archive_read_program() + r = __archive_read_programl(self, "unlzma", "unlzma", NULL); + /* Note: We set the format here even if __archive_read_programl() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ self->code = ARCHIVE_COMPRESSION_LZMA; @@ -958,8 +958,8 @@ xz_bidder_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "unxz"); - /* Note: We set the format here even if __archive_read_program() + r = __archive_read_programl(self, "unxz", "unxz", NULL); + /* Note: We set the format here even if __archive_read_programl() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ self->code = ARCHIVE_COMPRESSION_XZ; @@ -972,8 +972,8 @@ lzip_bidder_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "unlzip"); - /* Note: We set the format here even if __archive_read_program() + r = __archive_read_programl(self, "unlzip", "unlzip", NULL); + /* Note: We set the format here even if __archive_read_programl() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ self->code = ARCHIVE_COMPRESSION_LZIP;