[EMAIL PROTECTED] writes:
> I just noticed an old bug in gzip. The global foreground is never
> initialized.
OK, but is that a bug? C89 says that static variables must be
initialized to zero. These days GNU software tends to assume C89 or
better (it's too soon to assume C99).
Anyway, I installed this patch:
2007-02-11 Paul Eggert <[EMAIL PROTECTED]>
* gzip.c (foreground): Initialize to zero. This doesn't fix a bug
since C guarantees it's zero, but it's more consistent with the
rest of the code. Problem reported by Mark Adler.
--- gzip.c 5 Feb 2007 20:54:26 -0000 1.14
+++ gzip.c 12 Feb 2007 05:24:32 -0000
@@ -199,7 +199,7 @@ int verbose = 0; /* be verbose (-v)
int quiet = 0; /* be very quiet (-q) */
int do_lzw = 0; /* generate output compatible with old compress (-Z) */
int test = 0; /* test .gz file integrity */
-int foreground; /* set if program run in foreground */
+int foreground = 0; /* set if program run in foreground */
char *program_name; /* program name */
int maxbits = BITS; /* max bits per code for LZW */
int method = DEFLATED;/* compression method */