diff options
author | rsc <devnull@localhost> | 2004-04-19 05:54:21 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-19 05:54:21 +0000 |
commit | 892de7987409ccd209dd4f43fb7717408d4a04bd (patch) | |
tree | 9304c5df084b72d43fdbd284cf490630c6c406b0 /src/cmd/gzip | |
parent | 6b53e2a4d0d41305efa4b8b0800d119a13478ded (diff) | |
download | plan9port-892de7987409ccd209dd4f43fb7717408d4a04bd.tar.gz plan9port-892de7987409ccd209dd4f43fb7717408d4a04bd.tar.bz2 plan9port-892de7987409ccd209dd4f43fb7717408d4a04bd.zip |
various little bug fixes
Diffstat (limited to 'src/cmd/gzip')
-rw-r--r-- | src/cmd/gzip/gzip.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cmd/gzip/gzip.c b/src/cmd/gzip/gzip.c index 10954d3a..f37405b9 100644 --- a/src/cmd/gzip/gzip.c +++ b/src/cmd/gzip/gzip.c @@ -29,13 +29,29 @@ void main(int argc, char *argv[]) { int i, ok, stdout; + char **oargv; + oargv = argv; level = 6; stdout = 0; ARGBEGIN{ case 'D': debug++; break; + case 'd': + /* + * gnu tar expects gzip -d to decompress + * humor it. ugh. + */ + /* remove -d from command line - magic! */ + if(strcmp(argv[0], "-d") == 0){ + while(*argv++) + *(argv-1) = *argv; + }else + memmove(_args-1, _args, strlen(_args)+1); + exec("gunzip", oargv); + sysfatal("exec gunzip failed"); + break; case 'v': verbose++; break; |