|
|
|
@ -23,21 +23,23 @@ Index: gzip.c
|
|
|
|
|
#ifndef MAXSEG_64K
|
|
|
|
|
DECLARE(ush, tab_prefix, 1L<<BITS);
|
|
|
|
|
#else
|
|
|
|
|
@@ -915,6 +946,7 @@
|
|
|
|
|
{
|
|
|
|
|
struct stat ostat; /* stat for ofname */
|
|
|
|
|
int flags = O_WRONLY | O_CREAT | O_EXCL | O_BINARY;
|
|
|
|
|
+ char *baseout;
|
|
|
|
|
Index: gzip.c
|
|
|
|
|
--- gzip.c.orig 2002-09-28 09:38:43.000000000 +0200
|
|
|
|
|
+++ gzip.c 2005-07-24 18:20:41.621179000 +0200
|
|
|
|
|
@@ -1225,6 +1225,7 @@
|
|
|
|
|
char magic[2]; /* magic header */
|
|
|
|
|
int imagic1; /* like magic[1], but can represent EOF */
|
|
|
|
|
ulg stamp; /* time stamp */
|
|
|
|
|
+ char *base2;
|
|
|
|
|
|
|
|
|
|
if (ascii && decompress) {
|
|
|
|
|
flags &= ~O_BINARY; /* force ascii text mode */
|
|
|
|
|
@@ -927,6 +959,9 @@
|
|
|
|
|
}
|
|
|
|
|
/* Create the output file */
|
|
|
|
|
remove_ofname = 1;
|
|
|
|
|
+ baseout = base_name(ofname);
|
|
|
|
|
+ strncpy(ofname, baseout, sizeof(ofname));
|
|
|
|
|
+ ofname[sizeof(ofname) - 1] = '\0';
|
|
|
|
|
ofd = OPEN(ofname, flags, RW_USER);
|
|
|
|
|
if (ofd == -1) {
|
|
|
|
|
progerror(ofname);
|
|
|
|
|
/* If --force and --stdout, zcat == cat, so do not complain about
|
|
|
|
|
* premature end of file: use try_byte instead of get_byte.
|
|
|
|
|
@@ -1324,6 +1325,8 @@
|
|
|
|
|
error("corrupted input -- file name too large");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
+ base2 = base_name (base);
|
|
|
|
|
+ strcpy(base, base2);
|
|
|
|
|
/* If necessary, adapt the name to local OS conventions: */
|
|
|
|
|
if (!list) {
|
|
|
|
|
MAKE_LEGAL_NAME(base);
|
|
|
|
|