Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/gzip Set the XFL field of the gzip header to indicat...



details:   https://anonhg.NetBSD.org/src/rev/f5256a399046
branches:  trunk
changeset: 569752:f5256a399046
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Sep 04 10:48:57 2004 +0000

description:
Set the XFL field of the gzip header to indicate maximum compression or
fast compression.  Fixes PR bin/26812
Add references the the 3 relevant RFCs

diffstat:

 usr.bin/gzip/gzip.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 444db548daae -r f5256a399046 usr.bin/gzip/gzip.c
--- a/usr.bin/gzip/gzip.c       Sat Sep 04 07:09:35 2004 +0000
+++ b/usr.bin/gzip/gzip.c       Sat Sep 04 10:48:57 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gzip.c,v 1.64 2004/08/31 10:14:30 he Exp $     */
+/*     $NetBSD: gzip.c,v 1.65 2004/09/04 10:48:57 dsl Exp $    */
 
 /*
  * Copyright (c) 1997, 1998, 2003, 2004 Matthew R. Green
@@ -32,12 +32,16 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004 Matthew R. Green\n\
      All rights reserved.\n");
-__RCSID("$NetBSD: gzip.c,v 1.64 2004/08/31 10:14:30 he Exp $");
+__RCSID("$NetBSD: gzip.c,v 1.65 2004/09/04 10:48:57 dsl Exp $");
 #endif /* not lint */
 
 /*
  * gzip.c -- GPL free gzip using zlib.
  *
+ * RFC 1950 covers the zlib format
+ * RFC 1951 covers the deflate format
+ * RFC 1952 covers the gzip format
+ *
  * TODO:
  *     - use mmap where possible
  *     - handle some signals better (remove outfile?)
@@ -522,7 +526,8 @@
                     (mtime >> 8) & 0xff,
                     (mtime >> 16) & 0xff,
                     (mtime >> 24) & 0xff,
-                    0, OS_CODE, origname);
+                    numflag == 1 ? 4 : numflag == 9 ? 2 : 0,
+                    OS_CODE, origname);
        if (i >= BUFLEN)     
                /* this need PATH_MAX > BUFLEN ... */
                maybe_err("snprintf");



Home | Main Index | Thread Index | Old Index