Fossil

Diff
Login

Differences From Artifact [243d1a008a]:

To Artifact [b67cd6f043]:


79
80
81
82
83
84
85
86

87
88
89
90
91
92
93
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93







-
+








/*
** Set the date and time from a julian day number.
*/
void zip_set_timedate(double rDate){
  char *zDate = db_text(0, "SELECT datetime(%.17g)", rDate);
  zip_set_timedate_from_str(zDate);
  free(zDate);
  fossil_free(zDate);
  unixTime = (rDate - 2440587.5)*86400.0;
}

/*
** If the given filename includes one or more directory entries, make
** sure the directories are already in the archive.  If they are not
** in the archive, add them.
265
266
267
268
269
270
271
272

273
274

275
276
277
278
279
280
281
265
266
267
268
269
270
271

272
273

274
275
276
277
278
279
280
281







-
+

-
+







  put16(&zBuf[20], 0);
  blob_append(&body, zBuf, 22);
  blob_reset(&toc);
  *pZip = body;
  blob_zero(&body);
  nEntry = 0;
  for(i=0; i<nDir; i++){
    free(azDir[i]);
    fossil_free(azDir[i]);
  }
  free(azDir);
  fossil_free(azDir);
  nDir = 0;
  azDir = 0;
}

/*
** COMMAND: test-filezip
**
442
443
444
445
446
447
448
449
450


451
452
453
442
443
444
445
446
447
448


449
450
451
452
453







-
-
+
+



  rid = name_to_typed_rid(nRid?zRid:zName,"ci");
  if( rid==0 ){
    @ Not found
    return;
  }
  if( nRid==0 && nName>10 ) zName[10] = 0;
  zip_of_baseline(rid, &zip, zName);
  free( zName );
  free( zRid );
  fossil_free( zName );
  fossil_free( zRid );
  cgi_set_content(&zip);
  cgi_set_content_type("application/zip");
}