Move flush_outbuf to the file in which it is used, and by doing so fix a
nasty error dealing with two different variables with the same name.
This commit is contained in:
parent
d8ad76cb31
commit
7918e1fd54
@ -1176,21 +1176,6 @@ void clear_bufs(void)
|
|||||||
bytes_in = bytes_out = 0L;
|
bytes_in = bytes_out = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================================================================
|
|
||||||
* Write the output buffer outbuf[0..outcnt-1] and update bytes_out.
|
|
||||||
* (used for the compressed data only)
|
|
||||||
*/
|
|
||||||
void flush_outbuf()
|
|
||||||
{
|
|
||||||
if (outcnt == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!test_mode)
|
|
||||||
write_buf(ofd, (char *) outbuf, outcnt);
|
|
||||||
bytes_out += (ulg) outcnt;
|
|
||||||
outcnt = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ======================================================================== */
|
/* ======================================================================== */
|
||||||
int gunzip_main(int argc, char **argv)
|
int gunzip_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -3380,3 +3380,17 @@ unsigned size;
|
|||||||
isize += (ulg) len;
|
isize += (ulg) len;
|
||||||
return (int) len;
|
return (int) len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===========================================================================
|
||||||
|
* Write the output buffer outbuf[0..outcnt-1] and update bytes_out.
|
||||||
|
* (used for the compressed data only)
|
||||||
|
*/
|
||||||
|
void flush_outbuf()
|
||||||
|
{
|
||||||
|
if (outcnt == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
write_buf(ofd, (char *) outbuf, outcnt);
|
||||||
|
bytes_out += (ulg) outcnt;
|
||||||
|
outcnt = 0;
|
||||||
|
}
|
||||||
|
15
gunzip.c
15
gunzip.c
@ -1176,21 +1176,6 @@ void clear_bufs(void)
|
|||||||
bytes_in = bytes_out = 0L;
|
bytes_in = bytes_out = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================================================================
|
|
||||||
* Write the output buffer outbuf[0..outcnt-1] and update bytes_out.
|
|
||||||
* (used for the compressed data only)
|
|
||||||
*/
|
|
||||||
void flush_outbuf()
|
|
||||||
{
|
|
||||||
if (outcnt == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!test_mode)
|
|
||||||
write_buf(ofd, (char *) outbuf, outcnt);
|
|
||||||
bytes_out += (ulg) outcnt;
|
|
||||||
outcnt = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ======================================================================== */
|
/* ======================================================================== */
|
||||||
int gunzip_main(int argc, char **argv)
|
int gunzip_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
14
gzip.c
14
gzip.c
@ -3380,3 +3380,17 @@ unsigned size;
|
|||||||
isize += (ulg) len;
|
isize += (ulg) len;
|
||||||
return (int) len;
|
return (int) len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===========================================================================
|
||||||
|
* Write the output buffer outbuf[0..outcnt-1] and update bytes_out.
|
||||||
|
* (used for the compressed data only)
|
||||||
|
*/
|
||||||
|
void flush_outbuf()
|
||||||
|
{
|
||||||
|
if (outcnt == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
write_buf(ofd, (char *) outbuf, outcnt);
|
||||||
|
bytes_out += (ulg) outcnt;
|
||||||
|
outcnt = 0;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user