aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-11-08 06:52:57 +0000
committerMatt Kraai <kraai@debian.org>2000-11-08 06:52:57 +0000
commit7918e1fd549adbcf1df30f73914104436504d5e5 (patch)
tree2e6db6a2924c6cf805c0ccd0f827c8bf35b21ee9
parentd8ad76cb31ff7c4b2d97cc66eafc4297f5cea7d7 (diff)
downloadbusybox-7918e1fd549adbcf1df30f73914104436504d5e5.tar.gz
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.
-rw-r--r--archival/gunzip.c15
-rw-r--r--archival/gzip.c14
-rw-r--r--gunzip.c15
-rw-r--r--gzip.c14
4 files changed, 28 insertions, 30 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 1ff3c40fb..70b25bdb0 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -1176,21 +1176,6 @@ void clear_bufs(void)
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)
{
diff --git a/archival/gzip.c b/archival/gzip.c
index add94d0d7..2e147b1ca 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -3380,3 +3380,17 @@ unsigned size;
isize += (ulg) 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;
+}
diff --git a/gunzip.c b/gunzip.c
index 1ff3c40fb..70b25bdb0 100644
--- a/gunzip.c
+++ b/gunzip.c
@@ -1176,21 +1176,6 @@ void clear_bufs(void)
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)
{
diff --git a/gzip.c b/gzip.c
index add94d0d7..2e147b1ca 100644
--- a/gzip.c
+++ b/gzip.c
@@ -3380,3 +3380,17 @@ unsigned size;
isize += (ulg) 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;
+}