version 1.47.2.1, 2004/01/31 04:17:53 |
version 1.48, 2003/12/09 07:34:55 |
|
|
char *nargv[512]; /* some estimate based on ARG_MAX */ |
char *nargv[512]; /* some estimate based on ARG_MAX */ |
int bits, exists, oreg, ch, error, i, rc, oflag; |
int bits, exists, oreg, ch, error, i, rc, oflag; |
|
|
bits = cat = oflag = decomp = 0; |
bits = oflag = 0; |
nosave = -1; |
nosave = -1; |
p = __progname; |
p = __progname; |
if (p[0] == 'g') { |
if (p[0] == 'g') { |
|
|
decomp++; |
decomp++; |
break; |
break; |
case 'V': |
case 'V': |
printf("%s\n%s\n%s\n", main_rcsid, |
printf("%s\n%s\n", main_rcsid, gz_rcsid); |
#ifndef SMALL |
#ifndef SMALL |
z_rcsid, |
printf("%s\n%s\n", z_rcsid, null_rcsid); |
#endif |
#endif |
gz_rcsid); |
|
exit (0); |
exit (0); |
case 'v': |
case 'v': |
verbose++; |
verbose++; |
|
|
if (decomp) { |
if (decomp) { |
if (set_outfile(infile, outfile, |
if (set_outfile(infile, outfile, |
sizeof outfile) == NULL) { |
sizeof outfile) == NULL) { |
if (!recurse) { |
if (!recurse) |
warnx("%s: unknown suffix: " |
warnx("%s: unknown suffix: " |
"ignored", infile); |
"ignored", infile); |
rc = rc ? rc : WARNING; |
|
} |
|
continue; |
continue; |
} |
} |
} else { |
} else { |
|
|
"%s%s", infile, suffix) >= sizeof(outfile)) { |
"%s%s", infile, suffix) >= sizeof(outfile)) { |
warnx("%s%s: name too long", |
warnx("%s%s: name too long", |
infile, suffix); |
infile, suffix); |
rc = rc ? rc : WARNING; |
|
continue; |
continue; |
} |
} |
} |
} |
|
|
static u_int nruns; |
static u_int nruns; |
char *timestr; |
char *timestr; |
|
|
if (name != NULL && strcmp(name, "/dev/stdout") == 0) |
|
name += 5; |
|
|
|
if (nruns == 0) { |
if (nruns == 0) { |
if (verbose >= 0) { |
if (verbose >= 0) { |
if (verbose > 0) |
if (verbose > 0) |
fputs("method crc date time ", stdout); |
fputs("method crc date time ", stdout); |
puts("compressed uncompr. ratio uncompressed_name"); |
puts("compressed uncompressed ratio uncompressed_name"); |
} |
} |
} |
} |
nruns++; |
nruns++; |
|
|
if (name != NULL) { |
if (name != NULL) { |
|
if (strcmp(name, "/dev/stdout") == 0) |
|
name += 5; |
if (verbose > 0) { |
if (verbose > 0) { |
timestr = ctime(&info->mtime) + 4; |
timestr = ctime(&info->mtime) + 4; |
timestr[12] = '\0'; |
timestr[12] = '\0'; |
printf("%.5s %08x %s ", method->name, info->crc, timestr); |
if (timestr[4] == ' ') |
|
timestr[4] = '0'; |
|
printf("%-7.7s %08x %s ", method->name, info->crc, |
|
timestr); |
} |
} |
printf("%9lld %9lld %4.1f%% %s\n", |
printf("%10lld %10lld %4.1f%% %s\n", |
(long long)(info->total_in + info->hlen), |
(long long)(info->total_in + info->hlen), |
(long long)info->total_out, |
(long long)info->total_out, |
(info->total_out - info->total_in) * |
(info->total_out - info->total_in) * |
|
|
if (nruns < 3) /* only do totals for > 1 files */ |
if (nruns < 3) /* only do totals for > 1 files */ |
return; |
return; |
if (verbose > 0) |
if (verbose > 0) |
fputs(" ", stdout); |
fputs(" ", stdout); |
printf("%9lld %9lld %4.1f%% (totals)\n", |
printf("%10lld %10lld %4.1f%% (totals)\n", |
(long long)(compressed_total + header_total), |
(long long)(compressed_total + header_total), |
(long long)uncompressed_total, |
(long long)uncompressed_total, |
(uncompressed_total - compressed_total) * |
(uncompressed_total - compressed_total) * |