- i = 'n';
- } else {
- if (listing) {
- /* List entry */
- char dtbuf[sizeof("mm-dd-yyyy hh:mm")];
- sprintf(dtbuf, "%02u-%02u-%04u %02u:%02u",
- (zip.fmt.moddate >> 5) & 0xf, // mm: 0x01e0
- (zip.fmt.moddate) & 0x1f, // dd: 0x001f
- (zip.fmt.moddate >> 9) + 1980, // yy: 0xfe00
- (zip.fmt.modtime >> 11), // hh: 0xf800
- (zip.fmt.modtime >> 5) & 0x3f // mm: 0x07e0
- // seconds/2 not shown, encoded in -- 0x001f
- );
- if (!verbose) {
- // " Length Date Time Name\n"
- // "--------- ---------- ----- ----"
- printf( "%9u " "%s " "%s\n",
- (unsigned)zip.fmt.ucmpsize,
- dtbuf,
- dst_fn);
- } else {
- unsigned long percents = zip.fmt.ucmpsize - zip.fmt.cmpsize;
- if ((int32_t)percents < 0)
- percents = 0; /* happens if ucmpsize < cmpsize */
- percents = percents * 100;
- if (zip.fmt.ucmpsize)
- percents /= zip.fmt.ucmpsize;
- // " Length Method Size Cmpr Date Time CRC-32 Name\n"
- // "-------- ------ ------- ---- ---------- ----- -------- ----"
- printf( "%8u %s" "%9u%4u%% " "%s " "%08x " "%s\n",
- (unsigned)zip.fmt.ucmpsize,
- zip.fmt.method == 0 ? "Stored" : "Defl:N", /* Defl is method 8 */
-/* TODO: show other methods?
- * 1 - Shrunk
- * 2 - Reduced with compression factor 1
- * 3 - Reduced with compression factor 2
- * 4 - Reduced with compression factor 3
- * 5 - Reduced with compression factor 4
- * 6 - Imploded
- * 7 - Reserved for Tokenizing compression algorithm
- * 9 - Deflate64
- * 10 - PKWARE Data Compression Library Imploding
- * 11 - Reserved by PKWARE
- * 12 - BZIP2
- * 14 - LZMA
- */
- (unsigned)zip.fmt.cmpsize,
- (unsigned)percents,
- dtbuf,
- zip.fmt.crc32,
- dst_fn);
- total_size += zip.fmt.cmpsize;
+ goto skip_cmpsize;
+ }
+
+ if (opts & OPT_l) {
+ /* List entry */
+ char dtbuf[sizeof("mm-dd-yyyy hh:mm")];
+ sprintf(dtbuf, "%02u-%02u-%04u %02u:%02u",
+ (zip.fmt.moddate >> 5) & 0xf, // mm: 0x01e0
+ (zip.fmt.moddate) & 0x1f, // dd: 0x001f
+ (zip.fmt.moddate >> 9) + 1980, // yy: 0xfe00
+ (zip.fmt.modtime >> 11), // hh: 0xf800
+ (zip.fmt.modtime >> 5) & 0x3f // mm: 0x07e0
+ // seconds/2 not shown, encoded in -- 0x001f
+ );
+ if (!verbose) {
+ // " Length Date Time Name\n"
+ // "--------- ---------- ----- ----"
+ printf( "%9u " "%s " "%s\n",
+ (unsigned)zip.fmt.ucmpsize,
+ dtbuf,
+ dst_fn);
+ } else {
+ char method6[7];
+ unsigned long percents;
+
+ sprintf(method6, "%6u", zip.fmt.method);
+ if (zip.fmt.method == 0) {
+ strcpy(method6, "Stored");