summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3bf4408)
These platforms were not supported anyway, and their code was
suffering from bitrot. This patch may also fix some file name
glitches on MS-Windowsish platforms.
* bootstrap.conf (gnulib_modules): Add dosname.
* gzip.c: Include dosname.h.
(shorten_name, treat_dir): Use last_component rather than looking
at path separators by hand.
* tailor.h: Remove sections on porting to VMS and to Amiga,
since dosname.h doesn't support these platforms anyway.
(PATH_SEP2, PATH_SEP3, STDC_HEADERS, SUFFIX_SEP, RECORD_IO)
(HAVE_CHOWN, HAVE_LSTAT, HAVE_SYS_DIR_H, direct): Remove. All
uses removed. Many uses replaced by calls to ISSLASH and/or
last_component.
* Noteworthy changes in release ?.? (????-??-??) [?]
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug fixes
+
+ Support for VMS and Amiga has been removed. It was not working anyway,
+ and it reportedly caused file name glitches on MS-Windowsish platforms.
+
* Noteworthy changes in release 1.8 (2016-04-26) [stable]
* Noteworthy changes in release 1.8 (2016-04-26) [stable]
gzip is free software, you can redistribute it and/or modify it under
the terms of the GNU General Public License, a copy of which is
gzip is free software, you can redistribute it and/or modify it under
the terms of the GNU General Public License, a copy of which is
-provided under the name COPYING. The latest version of gzip are always
-available from ftp://ftp.gnu.org/gnu/gzip or in any of the gnu
+provided under the name COPYING. The latest version of gzip is always
+available from ftp://ftp.gnu.org/gnu/gzip or in any of the GNU
-- sources in gzip-*.tar (or .shar or .tar.gz).
-- MSDOS lha self-extracting exe in gzip-msdos-*.exe. Once extracted,
- copy gzip.exe to gunzip.exe and zcat.exe, or use "gzip -d" to decompress.
- gzip386.exe runs much faster but only on 386 and above; it was compiled with
- djgpp 1.10 available in directory omnigate.clarkson.edu:/pub/msdos/djgpp.
-
-A VMS executable is in ftp://ftp.spc.edu/[.macro32.savesets]gzip-1-*.zip
-(use [.macro32]unzip.exe to extract). A PRIMOS executable is available
-in ftp://ftp.lysator.liu.se/pub/primos/run/gzip.run.
-
-Some ftp servers can automatically make a tar.Z from a tar file. If
-you are getting gzip for the first time, you can ask for a tar.Z file
-instead of the much larger tar file.
-
Many thanks to those who provided me with bug reports and feedback.
See the files THANKS and ChangeLog for more details.
Many thanks to those who provided me with bug reports and feedback.
See the files THANKS and ChangeLog for more details.
Some of the planned features include:
Some of the planned features include:
-- Remove some of the old porting cruft. since we no longer support
- FIXME-2011: in mid to late 2011, remove the following directories:
- amiga, atari, msdos, nt, os2, vms
+- Remove some of the old porting cruft, since we no longer support it.
- Separate out the shell scripts like gzexe into a new little package;
these scripts are less used and less reliable and should be optional.
- Separate out the shell scripts like gzexe into a new little package;
these scripts are less used and less reliable and should be optional.
calloc
close
dirname-lgpl
calloc
close
dirname-lgpl
@command{gzip} reduces the size of the named files using Lempel--Ziv coding
(LZ77). Whenever possible, each file is replaced by one with the
extension @samp{.gz}, while keeping the same ownership modes, access and
@command{gzip} reduces the size of the named files using Lempel--Ziv coding
(LZ77). Whenever possible, each file is replaced by one with the
extension @samp{.gz}, while keeping the same ownership modes, access and
-modification times. (The default extension is @samp{-gz} for @abbr{VMS},
+modification times. (The default extension is
@samp{z} for @abbr{MSDOS}, @abbr{OS/2} @abbr{FAT} and Atari.)
If no files are specified or
if a file name is @file{-}, the standard input is compressed to the standard
@samp{z} for @abbr{MSDOS}, @abbr{OS/2} @abbr{FAT} and Atari.)
If no files are specified or
if a file name is @file{-}, the standard input is compressed to the standard
exec gzip -9 "$@@"
@end example
exec gzip -9 "$@@"
@end example
-On @abbr{VMS}, the name of the obsolescent environment variable is
-@env{GZIP_OPT}, to avoid a conflict with the symbol set for invocation
-of the program.
-
@node Tapes
@chapter Using @command{gzip} on tapes
@cindex tapes
@node Tapes
@chapter Using @command{gzip} on tapes
@cindex tapes
.BR "\&.gz" ,
while keeping the same ownership modes, access and modification times.
(The default extension is
.BR "\&.gz" ,
while keeping the same ownership modes, access and modification times.
(The default extension is
.B "z"
for MSDOS, OS/2 FAT, Windows NT FAT and Atari.)
If no files are specified, or if a file name is "-", the standard input is
.B "z"
for MSDOS, OS/2 FAT, Windows NT FAT and Atari.)
If no files are specified, or if a file name is "-", the standard input is
#! /bin/sh
export PATH=/usr/bin
exec gzip \-9 "$@"
#! /bin/sh
export PATH=/usr/bin
exec gzip \-9 "$@"
-
-On VMS, the name of the obsolescent environment variable is GZIP_OPT, to
-avoid a conflict with the symbol set for invocation of the program.
.SH "SEE ALSO"
znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1)
.PP
.SH "SEE ALSO"
znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1)
.PP
* or stdout with -c option or if stdin used as input.
* If the output file name had to be truncated, the original name is kept
* in the compressed file.
* or stdout with -c option or if stdin used as input.
* If the output file name had to be truncated, the original name is kept
* in the compressed file.
- * On MSDOS, file.tmp -> file.tmz. On VMS, file.tmp -> file.tmp-gz.
+ * On MSDOS, file.tmp -> file.tmz.
*
* Using gz on MSDOS would create too many file name conflicts. For
* example, foo.txt -> foo.tgz (.tgz must be reserved as shorthand for
*
* Using gz on MSDOS would create too many file name conflicts. For
* example, foo.txt -> foo.tgz (.tgz must be reserved as shorthand for
#include "timespec.h"
#include "dirname.h"
#include "timespec.h"
#include "dirname.h"
#include "fcntl--.h"
#include "getopt.h"
#include "ignore-value.h"
#include "fcntl--.h"
#include "getopt.h"
#include "ignore-value.h"
program_name = gzip_base_name (argv[0]);
proglen = strlen (program_name);
program_name = gzip_base_name (argv[0]);
proglen = strlen (program_name);
- /* Suppress .exe for MSDOS, OS/2 and VMS: */
+ /* Suppress .exe for MSDOS and OS/2: */
if (4 < proglen && strequ (program_name + proglen - 4, ".exe"))
program_name[proglen - 4] = '\0';
if (4 < proglen && strequ (program_name + proglen - 4, ".exe"))
program_name[proglen - 4] = '\0';
* gzip even if it is invoked under the name gunzip or zcat.
*
* Systems which do not support links can still use -d or -dc.
* gzip even if it is invoked under the name gunzip or zcat.
*
* Systems which do not support links can still use -d or -dc.
- * Ignore an .exe extension for MSDOS, OS/2 and VMS.
+ * Ignore an .exe extension for MSDOS and OS/2.
*/
if (strncmp (program_name, "un", 2) == 0 /* ungzip, uncompress */
|| strncmp (program_name, "gun", 3) == 0) /* gunzip */
*/
if (strncmp (program_name, "un", 2) == 0 /* ungzip, uncompress */
|| strncmp (program_name, "gun", 3) == 0) /* gunzip */
* also accepted suffixes. For Unix, we do not want to accept any
* .??z suffix as indicating a compressed file; some people use .xyz
* to denote volume data.
* also accepted suffixes. For Unix, we do not want to accept any
* .??z suffix as indicating a compressed file; some people use .xyz
* to denote volume data.
- * On systems allowing multiple versions of the same file (such as VMS),
- * this function removes any version suffix in the given name.
*/
local char *get_suffix(name)
char *name;
*/
local char *get_suffix(name)
char *name;
: 0] = z_suffix;
suf = known_suffixes + suffix_of_builtin;
: 0] = z_suffix;
suf = known_suffixes + suffix_of_builtin;
-#ifdef SUFFIX_SEP
- /* strip a version number from the file name */
- {
- char *v = strrchr(name, SUFFIX_SEP);
- if (v != NULL) *v = '\0';
- }
-#endif
nlen = strlen(name);
if (nlen <= MAX_SUFFIX+2) {
strcpy(suffix, name);
nlen = strlen(name);
if (nlen <= MAX_SUFFIX+2) {
strcpy(suffix, name);
slen = strlen(suffix);
do {
int s = strlen(*suf);
slen = strlen(suffix);
do {
int s = strlen(*suf);
- if (slen > s && suffix[slen-s-1] != PATH_SEP
+ if (slen > s && ! ISSLASH (suffix[slen - s - 1])
&& strequ(suffix + slen - s, *suf)) {
return name+nlen-s;
}
&& strequ(suffix + slen - s, *suf)) {
return name+nlen-s;
}
flags |= O_NOFOLLOW;
else
{
flags |= O_NOFOLLOW;
else
{
-#if HAVE_LSTAT || defined lstat
if (lstat (name, st) != 0)
return -1;
else if (S_ISLNK (st->st_mode))
if (lstat (name, st) != 0)
return -1;
else if (S_ISLNK (st->st_mode))
progerror(ifname);
return -1;
}
progerror(ifname);
return -1;
}
- /* file.ext doesn't exist, try adding a suffix (after removing any
- * version number for VMS).
- */
+ /* File.ext doesn't exist. Try adding a suffix. */
s = get_suffix(ifname);
if (s != NULL) {
progerror(ifname); /* ifname already has z suffix and does not exist */
s = get_suffix(ifname);
if (s != NULL) {
progerror(ifname); /* ifname already has z suffix and does not exist */
method = -1; /* unknown yet */
part_nb++; /* number of parts in gzip file */
header_bytes = 0;
method = -1; /* unknown yet */
part_nb++; /* number of parts in gzip file */
header_bytes = 0;
- last_member = RECORD_IO;
/* assume multiple members in gzip file except for record oriented I/O */
if (memcmp(magic, GZIP_MAGIC, 2) == 0
/* assume multiple members in gzip file except for record oriented I/O */
if (memcmp(magic, GZIP_MAGIC, 2) == 0
bytes_out = -1L;
bytes_in = ifile_size;
bytes_out = -1L;
bytes_in = ifile_size;
- if (!RECORD_IO && method == DEFLATED && !last_member) {
+ if (method == DEFLATED && !last_member) {
/* Get the crc and uncompressed size for gzip'ed (not zip'ed) files.
* If the lseek fails, we could use read() to get to the end, but
* --list is used to get quick results.
/* Get the crc and uncompressed size for gzip'ed (not zip'ed) files.
* If the lseek fails, we could use read() to get to the end, but
* --list is used to get quick results.
* 1234.678.012.gz -> 123.678.012.gz
*/
do {
* 1234.678.012.gz -> 123.678.012.gz
*/
do {
- p = strrchr(name, PATH_SEP);
- p = p ? p+1 : name;
+ p = last_component (name);
while (*p) {
plen = strcspn(p, PART_SEP);
p += plen;
while (*p) {
plen = strcspn(p, PART_SEP);
p += plen;
continue;
if (len + entrylen < MAX_PATH_LEN - 2) {
strcpy(nbuf,dir);
continue;
if (len + entrylen < MAX_PATH_LEN - 2) {
strcpy(nbuf,dir);
- if (len != 0 /* dir = "" means current dir on Amiga */
-#ifdef PATH_SEP2
- && dir[len-1] != PATH_SEP2
-#endif
-#ifdef PATH_SEP3
- && dir[len-1] != PATH_SEP3
-#endif
- ) {
- nbuf[len++] = PATH_SEP;
- }
+ if (*last_component (nbuf) && !ISSLASH (nbuf[len - 1]))
+ nbuf[len++] = '/';
strcpy (nbuf + len, entry);
treat_file(nbuf);
} else {
strcpy (nbuf + len, entry);
treat_file(nbuf);
} else {
# define predec(An) -(An)
# define postinc(An) (An)+
# define predec(An) -(An)
# define postinc(An) (An)+
-#else /* default style (Sun 3, NeXT, Amiga, Atari) */
+#else /* default style (Sun 3, NeXT, Atari) */
# define GLOBAL(symbol) .globl symbol
# define TEXT .text
# define GLOBAL(symbol) .globl symbol
# define TEXT .text
# define HAVE_SYS_UTIME_H
# endif
# endif
# define HAVE_SYS_UTIME_H
# endif
# endif
-# define PATH_SEP2 '\\'
-# define PATH_SEP3 ':'
# define MAX_PATH_LEN 128
# define NO_MULTIPLE_DOTS
# define MAX_EXT_CHARS 3
# define Z_SUFFIX "z"
# define MAX_PATH_LEN 128
# define NO_MULTIPLE_DOTS
# define MAX_EXT_CHARS 3
# define Z_SUFFIX "z"
# define NO_SIZE_CHECK
# define UNLINK_READONLY_BUG
# define casemap(c) tolow(c) /* Force file names to lower case */
# define NO_SIZE_CHECK
# define UNLINK_READONLY_BUG
# define casemap(c) tolow(c) /* Force file names to lower case */
-# define PATH_SEP2 '\\'
-# define PATH_SEP3 ':'
# define MAX_PATH_LEN 260
# ifdef OS2FAT
# define NO_MULTIPLE_DOTS
# define MAX_PATH_LEN 260
# ifdef OS2FAT
# define NO_MULTIPLE_DOTS
# define Z_SUFFIX "z"
# define casemap(c) tolow(c)
# endif
# define Z_SUFFIX "z"
# define casemap(c) tolow(c)
# endif
# define UNLINK_READONLY_BUG
# include <io.h>
# define OS_CODE 0x06
# define UNLINK_READONLY_BUG
# include <io.h>
# define OS_CODE 0x06
-#ifdef WIN32 /* Windows NT */
+#if defined WIN32 || defined _WIN32
# define HAVE_SYS_UTIME_H
# define HAVE_SYS_UTIME_H
-# define PATH_SEP2 '\\'
-# define PATH_SEP3 ':'
# define MAX_PATH_LEN 260
# define MAX_PATH_LEN 260
# define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
# define UNLINK_READONLY_BUG
# include <io.h>
# define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
# define UNLINK_READONLY_BUG
# include <io.h>
# define fcfree(ptr) free(ptr)
#endif
# define fcfree(ptr) free(ptr)
#endif
-#if defined(VAXC) || defined(VMS)
-# define PATH_SEP ']'
-# define PATH_SEP2 ':'
-# define SUFFIX_SEP ';'
-# define NO_MULTIPLE_DOTS
-# define NO_SIZE_CHECK
-# define Z_SUFFIX "-gz"
-# define RECORD_IO 1
-# define casemap(c) tolow(c)
-# define OS_CODE 0x02
-# define OPTIONS_VAR "GZIP_OPT"
-# define STDC_HEADERS
-# define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
-# include <file.h>
-# define unlink delete
-# ifdef VAXC
-# include <unixio.h>
-# endif
-#endif
-
-#ifdef AMIGA
-# define PATH_SEP2 ':'
-# define STDC_HEADERS
-# define OS_CODE 0x01
-# define ASMV
-# ifdef __GNUC__
-# define HAVE_CHOWN
-# define HAVE_LSTAT
-# else /* SASC */
-# define HAVE_SYS_DIR_H
-# include <fcntl.h> /* for read() and write() */
-# define direct dirent
- extern void _expand_args(int *argc, char ***argv);
-# define EXPAND(argc,argv) _expand_args(&argc,&argv);
-# endif
-#endif
-
#if defined(ATARI) || defined(atarist)
# define ASMV
# define OS_CODE 0x05
# ifdef TOSFS
#if defined(ATARI) || defined(atarist)
# define ASMV
# define OS_CODE 0x05
# ifdef TOSFS
-# define PATH_SEP2 '\\'
-# define PATH_SEP3 ':'
# define MAX_PATH_LEN 128
# define NO_MULTIPLE_DOTS
# define MAX_EXT_CHARS 3
# define MAX_PATH_LEN 128
# define NO_MULTIPLE_DOTS
# define MAX_EXT_CHARS 3
# define OS_CODE 0x03 /* assume Unix */
#endif
# define OS_CODE 0x03 /* assume Unix */
#endif
-#ifndef PATH_SEP
-# define PATH_SEP '/'
-#endif
-
#ifndef casemap
# define casemap(c) (c)
#endif
#ifndef casemap
# define casemap(c) (c)
#endif
# define EXPAND(argc,argv)
#endif
# define EXPAND(argc,argv)
#endif
-#ifndef RECORD_IO
-# define RECORD_IO 0
-#endif
-
#ifndef SET_BINARY_MODE
# define SET_BINARY_MODE(fd)
#endif
#ifndef SET_BINARY_MODE
# define SET_BINARY_MODE(fd)
#endif
#include "tailor.h"
#include "gzip.h"
#include "tailor.h"
#include "gzip.h"
#include <xalloc.h>
#ifndef CHAR_BIT
#include <xalloc.h>
#ifndef CHAR_BIT
gzip_base_name (fname)
char *fname;
{
gzip_base_name (fname)
char *fname;
{
- char *p;
-
- if ((p = strrchr(fname, PATH_SEP)) != NULL) fname = p+1;
-#ifdef PATH_SEP2
- if ((p = strrchr(fname, PATH_SEP2)) != NULL) fname = p+1;
-#endif
-#ifdef PATH_SEP3
- if ((p = strrchr(fname, PATH_SEP3)) != NULL) fname = p+1;
-#endif
-#ifdef SUFFIX_SEP
- if ((p = strrchr(fname, SUFFIX_SEP)) != NULL) *p = '\0';
-#endif
+ fname = last_component (fname);
if (casemap('A') == 'a') strlwr(fname);
return fname;
}
if (casemap('A') == 'a') strlwr(fname);
return fname;
}
(void)deflate();
#ifndef NO_SIZE_CHECK
(void)deflate();
#ifndef NO_SIZE_CHECK
- /* Check input size (but not in VMS -- variable record lengths mess it up)
- * and not on MSDOS -- diet in TSR mode reports an incorrect file size)
+ /* Check input size
+ * (but not on MSDOS -- diet in TSR mode reports an incorrect file size)
*/
if (ifile_size != -1L && bytes_in != ifile_size) {
fprintf(stderr, "%s: %s: file size changed while zipping\n",
*/
if (ifile_size != -1L && bytes_in != ifile_size) {
fprintf(stderr, "%s: %s: file size changed while zipping\n",