diff options
Diffstat (limited to 'src/cmd/bzip2')
-rw-r--r-- | src/cmd/bzip2/bzip2.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cmd/bzip2/bzip2.c b/src/cmd/bzip2/bzip2.c index 17c2d06d..e7ac9953 100644 --- a/src/cmd/bzip2/bzip2.c +++ b/src/cmd/bzip2/bzip2.c @@ -23,7 +23,9 @@ void main(int argc, char **argv) { int i, ok, stdout; + char **oargv; + oargv = argv; level = 6; stdout = 0; ARGBEGIN{ @@ -36,6 +38,20 @@ main(int argc, char **argv) case 'c': stdout++; break; + case 'd': + /* + * gnu tar expects bzip2 -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("bunzip2", oargv); + sysfatal("exec bunzip2 failed"); + break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': level = ARGC() - '0'; |