PERFORCE change 147226 for review
Anselm Strauss
strauss at FreeBSD.org
Tue Aug 12 12:05:40 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=147226
Change 147226 by strauss at strauss_marvelman on 2008/08/12 12:05:13
- Fix: Used wrong flag to indicate the use of data descriptors
- Fix: Used wrong format for extra time fields
Affected files ...
.. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#30 edit
Differences ...
==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#30 (text+ko) ====
@@ -47,7 +47,7 @@
#define ZIP_SIGNATURE_EXTRA_UNIX 0x7855
#define ZIP_VERSION_EXTRACT 0x0014 /* ZIP version 2.0 is needed. */
#define ZIP_VERSION_BY 0x0314 /* Made by UNIX, using ZIP version 2.0. */
-#define ZIP_FLAGS 0x04 /* Flagging bit 3 for using data descriptor. */
+#define ZIP_FLAGS 0x08 /* Flagging bit 3 (count from 0) for using data descriptor. */
static ssize_t archive_write_zip_data(struct archive_write *, const void *buff, size_t s);
static int archive_write_zip_finish(struct archive_write *);
@@ -99,10 +99,10 @@
struct zip_extra_data {
char time_id[2];
char time_size[2];
- struct time_data {
- char flag;
- char data[4];
- } mtime, atime, ctime;
+ char time_flag[1];
+ char mtime[4];
+ char atime[4];
+ char ctime[4];
char unix_id[2];
char unix_size[2];
char unix_uid[2];
@@ -234,13 +234,11 @@
/* Formatting extra data. */
zip_encode(sizeof(e), &h.extra_length, sizeof(h.extra_length));
zip_encode(ZIP_SIGNATURE_EXTRA_TIMESTAMP, &e.time_id, sizeof(e.time_id));
- zip_encode(sizeof(e.atime) + sizeof(e.mtime) + sizeof(e.ctime), &e.time_size, sizeof(e.time_size));
- zip_encode(0x01, &e.mtime.flag, sizeof(e.mtime.flag));
- zip_encode(archive_entry_mtime(entry), &e.mtime.data, sizeof(e.mtime.data));
- zip_encode(0x02, &e.atime.flag, sizeof(e.atime.flag));
- zip_encode(archive_entry_atime(entry), &e.atime.data, sizeof(e.atime.data));
- zip_encode(0x04, &e.ctime.flag, sizeof(e.ctime.flag));
- zip_encode(archive_entry_ctime(entry), &e.ctime.data, sizeof(e.ctime.data));
+ zip_encode(sizeof(e.atime) + sizeof(e.mtime) + sizeof(e.ctime) + sizeof(e.time_flag), &e.time_size, sizeof(e.time_size));
+ zip_encode(0x07, &e.time_flag, sizeof(e.time_flag));
+ zip_encode(archive_entry_mtime(entry), &e.mtime, sizeof(e.mtime));
+ zip_encode(archive_entry_atime(entry), &e.atime, sizeof(e.atime));
+ zip_encode(archive_entry_ctime(entry), &e.ctime, sizeof(e.ctime));
zip_encode(ZIP_SIGNATURE_EXTRA_UNIX, &e.unix_id, sizeof(e.unix_id));
zip_encode(sizeof(e.unix_uid) + sizeof(e.unix_gid), &e.unix_size, sizeof(e.unix_size));
zip_encode(archive_entry_uid(entry), &e.unix_uid, sizeof(e.unix_uid));
More information about the p4-projects
mailing list