1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00
freebsd/usr.bin/compress
Tom Rhodes 33ffdd8115 Don't truncate the output file before making sure that we can
read at least 1 byte from the input file without problems.  This
fixes a bug in uncompress(1) that causes the accidental removal
of files that happen to have the same name as the output file,
even when the uncompression fails and is aborted, i.e.:

$ echo hello world > hello
$ touch hello.Z
$ ls -l hello*
-rw-rw-r--  1 giorgos  giorgos  12 Jun 14 13:33 hello
-rw-rw-r--  1 giorgos  giorgos   0 Jun 14 13:33 hello.Z
$ ./uncompress -f hello
uncompress: hello.Z: Inappropriate file type or format
$ ls -l hello*
-rw-rw-r--  1 giorgos  giorgos  0 Jun 14 13:33 hello.Z
$

PR:		46787
Submitted by:	keramida
2003-06-14 13:41:31 +00:00
..
doc Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/ 2002-12-30 21:18:15 +00:00
compress.1
compress.c Don't truncate the output file before making sure that we can 2003-06-14 13:41:31 +00:00
Makefile
zopen.3
zopen.c
zopen.h