diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-05-17 01:42:43 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-05-17 01:42:43 +0000 |
commit | b4771590650540f44ee2c2ef0b72b040f494ed52 (patch) | |
tree | ee68f9784a140792108645032629dab128805dc4 /usr.bin/compress | |
parent | b635dacd577ddaff7e13c1e6eef32dfb93563279 (diff) | |
download | src-test2-b4771590650540f44ee2c2ef0b72b040f494ed52.tar.gz src-test2-b4771590650540f44ee2c2ef0b72b040f494ed52.zip |
Notes
Diffstat (limited to 'usr.bin/compress')
-rw-r--r-- | usr.bin/compress/compress.1 | 7 | ||||
-rw-r--r-- | usr.bin/compress/compress.c | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/usr.bin/compress/compress.1 b/usr.bin/compress/compress.1 index cb69bcbe2da4..b8a12e54ab33 100644 --- a/usr.bin/compress/compress.1 +++ b/usr.bin/compress/compress.1 @@ -79,8 +79,11 @@ output) for confirmation. If prompting is not possible or confirmation is not received, the files are not overwritten. .Pp -If no files are specified, the standard input is compressed or uncompressed -to the standard output. +If no files are specified or a +.Ar file +argument is a single dash +.Pq Ql - , +the standard input is compressed or uncompressed to the standard output. If either the input and output files are not regular files, the checks for reduction in size and file overwriting are not performed, the input file is not removed, and the attributes of the input file are not retained. diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c index 866e18719c93..f7d13732b6ce 100644 --- a/usr.bin/compress/compress.c +++ b/usr.bin/compress/compress.c @@ -140,7 +140,10 @@ main(argc, argv) for (; *argv; ++argv) switch(style) { case COMPRESS: - if (cat) { + if (strcmp(*argv, "-") == 0) { + compress("/dev/stdin", "/dev/stdout", bits); + break; + } else if (cat) { compress(*argv, "/dev/stdout", bits); break; } @@ -162,6 +165,10 @@ main(argc, argv) compress(*argv, newname, bits); break; case DECOMPRESS: + if (strcmp(*argv, "-") == 0) { + decompress("/dev/stdin", "/dev/stdout", bits); + break; + } len = strlen(*argv); if ((p = rindex(*argv, '.')) == NULL || strcmp(p, ".Z")) { |