unbzip2.c (a4bf5fb987611aeb78c422312b63b185e39982d7) unbzip2.c (90f528e8d7868a5d31dc35b24943c673bf67821d)
1/* $NetBSD: unbzip2.c,v 1.13 2009/12/05 03:23:37 mrg Exp $ */
1/* $NetBSD: unbzip2.c,v 1.14 2017/08/04 07:27:08 mrg Exp $ */
2
3/*-
4 * Copyright (c) 2006 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Simon Burge.
9 *

--- 50 unchanged lines hidden (view full) ---

60 /* Prepend. */
61 bzs.avail_in = prelen;
62 bzs.next_in = pre;
63
64 if (bytes_in)
65 *bytes_in = prelen;
66
67 while (ret == BZ_OK) {
2
3/*-
4 * Copyright (c) 2006 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Simon Burge.
9 *

--- 50 unchanged lines hidden (view full) ---

60 /* Prepend. */
61 bzs.avail_in = prelen;
62 bzs.next_in = pre;
63
64 if (bytes_in)
65 *bytes_in = prelen;
66
67 while (ret == BZ_OK) {
68 check_siginfo();
68 if (bzs.avail_in == 0 && !end_of_file) {
69 ssize_t n;
70
71 n = read(in, inbuf, BUFLEN);
72 if (n < 0)
73 maybe_err("read");
74 if (n == 0)
75 end_of_file = 1;
69 if (bzs.avail_in == 0 && !end_of_file) {
70 ssize_t n;
71
72 n = read(in, inbuf, BUFLEN);
73 if (n < 0)
74 maybe_err("read");
75 if (n == 0)
76 end_of_file = 1;
77 infile_newdata(n);
76 bzs.next_in = inbuf;
77 bzs.avail_in = n;
78 if (bytes_in)
79 *bytes_in += n;
80 }
81
82 bzs.next_out = outbuf;
83 bzs.avail_out = BUFLEN;

--- 58 unchanged lines hidden ---
78 bzs.next_in = inbuf;
79 bzs.avail_in = n;
80 if (bytes_in)
81 *bytes_in += n;
82 }
83
84 bzs.next_out = outbuf;
85 bzs.avail_out = BUFLEN;

--- 58 unchanged lines hidden ---