Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/gzip - make this WARNS=3 happy



details:   https://anonhg.NetBSD.org/src/rev/00238ef5eaae
branches:  trunk
changeset: 556685:00238ef5eaae
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Dec 23 15:02:40 2003 +0000

description:
- make this WARNS=3 happy
- add RCSID()
- document the version number

diffstat:

 usr.bin/gzip/gzip.1 |   9 +++++++--
 usr.bin/gzip/gzip.c |  22 ++++++++++++++--------
 2 files changed, 21 insertions(+), 10 deletions(-)

diffs (106 lines):

diff -r ae925b4ddc78 -r 00238ef5eaae usr.bin/gzip/gzip.1
--- a/usr.bin/gzip/gzip.1       Tue Dec 23 14:44:07 2003 +0000
+++ b/usr.bin/gzip/gzip.1       Tue Dec 23 15:02:40 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: gzip.1,v 1.2 2003/12/23 08:19:49 jdolecek Exp $
+.\"    $NetBSD: gzip.1,v 1.3 2003/12/23 15:02:40 mrg Exp $
 .\"
 .\" Copyright (c) 1997, 2003 Matthew R. Green
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd December 22, 2003
+.Dd December 24, 2003
 .Dt GZIP 1
 .Os
 .Sh NAME
@@ -160,6 +160,11 @@
 .Nm
 program for
 .Nx 2.0 .
+.Pp
+This manual documents
+.Nx
+.Nm
+version 2.0.
 .Sh AUTHORS
 The
 .Nx
diff -r ae925b4ddc78 -r 00238ef5eaae usr.bin/gzip/gzip.c
--- a/usr.bin/gzip/gzip.c       Tue Dec 23 14:44:07 2003 +0000
+++ b/usr.bin/gzip/gzip.c       Tue Dec 23 15:02:40 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gzip.c,v 1.3 2003/12/23 08:11:58 jdolecek Exp $        */
+/*     $NetBSD: gzip.c,v 1.4 2003/12/23 15:02:40 mrg Exp $     */
 
 /*
  * Copyright (c) 1997, 1998, 2003 Matthew R. Green
@@ -28,6 +28,13 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
+#ifndef lint
+__COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003 Matthew R. Green\n\
+     All rights reserved.\n");
+__RCSID("$NetBSD: gzip.c,v 1.4 2003/12/23 15:02:40 mrg Exp $");
+#endif /* not lint */
+
 /*
  * gzip.c -- GPL free gzip using zlib.
  *
@@ -56,8 +63,6 @@
 # define GZ_SUFFIX ".gz"
 #endif
 
-#define SUFFIX_LEN sizeof(GZ_SUFFIX)
-
 #define BUFLEN 4096
 
 #define ORIG_NAME 0x08
@@ -79,7 +84,7 @@
 static int     vflag;                  /* verbose mode */
 static const char *Sflag = GZ_SUFFIX;  /* suffix (.gz) */
 
-static int     suffix_len = SUFFIX_LEN; /* length of suffix; includes nul */
+static int     suffix_len;             /* length of suffix; includes nul */
 static char    *newfile;               /* name of newly created file */
 static char    *infile;                /* name of file coming in */
 
@@ -183,7 +188,6 @@
                        break;
                case 'S':
                        Sflag = optarg;
-                       suffix_len = strlen(Sflag) + 1;
                        break;
                case 't':
                        cflag = 1;
@@ -208,6 +212,8 @@
        if (dflag)
                gzipflags[0] = 'r';
 
+       suffix_len = strlen(Sflag) + 1;
+
        if (argc == 0) {
                if (dflag)      /* stdin mode */
                        handle_stdin();
@@ -724,14 +730,14 @@
 
 /* print compression statistics, and the new name (if there is one!) */
 static void
-print_verbage(char *file, char *newfile, ssize_t usize, ssize_t gsize)
+print_verbage(char *file, char *nfile, ssize_t usize, ssize_t gsize)
 {
        float percent = 100.0 - (100.0 * gsize / usize);
 
        fprintf(stderr, "%s:%s  %4.1f%%", file,
            strlen(file) < 7 ? "\t\t" : "\t", percent);
-       if (newfile)
-               fprintf(stderr, " -- replaced with %s", newfile);
+       if (nfile)
+               fprintf(stderr, " -- replaced with %s", nfile);
        fprintf(stderr, "\n");
        fflush(stderr);
 }



Home | Main Index | Thread Index | Old Index