]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Rework to avoid some C99-isms. <sigh>
authorTim Kientzle <kientzle@gmail.com>
Fri, 20 Nov 2015 05:07:56 +0000 (21:07 -0800)
committerTim Kientzle <kientzle@gmail.com>
Fri, 20 Nov 2015 05:07:56 +0000 (21:07 -0800)
libarchive/archive_write_set_format_warc.c

index 80abc6f4e4ee43074c92ff6edffd0896e97c58f1..a761d352632d18732ced257269c11a0d2aaa8f40 100644 (file)
@@ -182,6 +182,7 @@ _warc_header(struct archive_write *a, struct archive_entry *entry)
 {
        struct warc_s *w = a->format_data;
        struct archive_string hdr;
+       ssize_t r;
 #define MAX_HDR_SIZE 512
 
        /* check whether warcinfo record needs outputting */
@@ -190,12 +191,13 @@ _warc_header(struct archive_write *a, struct archive_entry *entry)
                        WT_INFO,
                        /*uri*/NULL,
                        /*urn*/NULL,
-                       /*rtm*/w->now,
-                       /*mtm*/w->now,
+                       /*rtm*/0,
+                       /*mtm*/0,
                        /*cty*/"application/warc-fields",
                        /*len*/sizeof(warcinfo) - 1U,
                };
-               ssize_t r;
+               wi.rtime = w->now;
+               wi.mtime = w->now;
 
                archive_string_init(&hdr);
                r = _popul_ehdr(&hdr, MAX_HDR_SIZE, wi);
@@ -226,14 +228,18 @@ _warc_header(struct archive_write *a, struct archive_entry *entry)
        if (w->typ == AE_IFREG) {
                warc_essential_hdr_t rh = {
                        WT_RSRC,
-                       /*uri*/archive_entry_pathname(entry),
+                       /*uri*/NULL,
                        /*urn*/NULL,
-                       /*rtm*/w->now,
-                       /*mtm*/archive_entry_mtime(entry),
+                       /*rtm*/0,
+                       /*mtm*/0,
                        /*cty*/NULL,
-                       /*len*/(size_t)archive_entry_size(entry),
+                       /*len*/0,
                };
                ssize_t r;
+               rh.tgturi = archive_entry_pathname(entry);
+               rh.rtime = w->now;
+               rh.mtime = archive_entry_mtime(entry);
+               rh.cntlen = (size_t)archive_entry_size(entry);
 
                archive_string_init(&hdr);
                r = _popul_ehdr(&hdr, MAX_HDR_SIZE, rh);