Fixed previous commit to actually work. The wrong variable was initialized
earlier (with style bugs of course), so zcat was an alias for uncompress instead of `uncompress -c'.
This commit is contained in:
parent
12d534d2f9
commit
d52ae8190d
@ -75,11 +75,12 @@ main(argc, argv)
|
|||||||
int argc;
|
int argc;
|
||||||
char *argv[];
|
char *argv[];
|
||||||
{
|
{
|
||||||
enum {COMPRESS, DECOMPRESS} style = COMPRESS;
|
enum {COMPRESS, DECOMPRESS} style;
|
||||||
size_t len;
|
size_t len;
|
||||||
int bits, cat, ch;
|
int bits, cat, ch;
|
||||||
char *p, newname[MAXPATHLEN];
|
char *p, newname[MAXPATHLEN];
|
||||||
|
|
||||||
|
cat = 0;
|
||||||
if ((p = rindex(argv[0], '/')) == NULL)
|
if ((p = rindex(argv[0], '/')) == NULL)
|
||||||
p = argv[0];
|
p = argv[0];
|
||||||
else
|
else
|
||||||
@ -89,12 +90,12 @@ main(argc, argv)
|
|||||||
else if (!strcmp(p, "compress"))
|
else if (!strcmp(p, "compress"))
|
||||||
style = COMPRESS;
|
style = COMPRESS;
|
||||||
else if (!strcmp(p, "zcat")) {
|
else if (!strcmp(p, "zcat")) {
|
||||||
style = DECOMPRESS;
|
|
||||||
cat = 1;
|
cat = 1;
|
||||||
|
style = DECOMPRESS;
|
||||||
} else
|
} else
|
||||||
errx(1, "unknown program name");
|
errx(1, "unknown program name");
|
||||||
|
|
||||||
bits = cat = 0;
|
bits = 0;
|
||||||
while ((ch = getopt(argc, argv, "b:cdfv")) != -1)
|
while ((ch = getopt(argc, argv, "b:cdfv")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'b':
|
case 'b':
|
||||||
|
Loading…
Reference in New Issue
Block a user