unzip.c (203977) | unzip.c (208957) |
---|---|
1/*- 2 * Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org> 3 * Copyright (c) 2007-2008 Dag-Erling Co�dan Sm�rgrav 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org> 3 * Copyright (c) 2007-2008 Dag-Erling Co�dan Sm�rgrav 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/usr.bin/unzip/unzip.c 203977 2010-02-16 22:53:18Z gavin $ | 28 * $FreeBSD: head/usr.bin/unzip/unzip.c 208957 2010-06-09 18:59:07Z delphij $ |
29 * 30 * This file would be much shorter if we didn't care about command-line 31 * compatibility with Info-ZIP's UnZip, which requires us to duplicate 32 * parts of libarchive in order to gain more detailed control of its 33 * behaviour for the purpose of implementing the -n, -o, -L and -a 34 * options. 35 */ 36 --- 820 unchanged lines hidden (view full) --- 857 struct archive *a; 858 struct archive_entry *e; 859 int fd, ret; 860 uintmax_t total_size, file_count, error_count; 861 862 if ((fd = open(fn, O_RDONLY)) < 0) 863 error("%s", fn); 864 | 29 * 30 * This file would be much shorter if we didn't care about command-line 31 * compatibility with Info-ZIP's UnZip, which requires us to duplicate 32 * parts of libarchive in order to gain more detailed control of its 33 * behaviour for the purpose of implementing the -n, -o, -L and -a 34 * options. 35 */ 36 --- 820 unchanged lines hidden (view full) --- 857 struct archive *a; 858 struct archive_entry *e; 859 int fd, ret; 860 uintmax_t total_size, file_count, error_count; 861 862 if ((fd = open(fn, O_RDONLY)) < 0) 863 error("%s", fn); 864 |
865 a = archive_read_new(); | 865 if ((a = archive_read_new()) == NULL) 866 error("archive_read_new failed"); 867 |
866 ac(archive_read_support_format_zip(a)); 867 ac(archive_read_open_fd(a, fd, 8192)); 868 869 if (!p_opt && !q_opt) 870 printf("Archive: %s\n", fn); 871 if (v_opt == 1) { 872 printf(" Length Date Time Name\n"); 873 printf(" -------- ---- ---- ----\n"); --- 168 unchanged lines hidden --- | 868 ac(archive_read_support_format_zip(a)); 869 ac(archive_read_open_fd(a, fd, 8192)); 870 871 if (!p_opt && !q_opt) 872 printf("Archive: %s\n", fn); 873 if (v_opt == 1) { 874 printf(" Length Date Time Name\n"); 875 printf(" -------- ---- ---- ----\n"); --- 168 unchanged lines hidden --- |