Fossil

Diff
Login

Diff

Differences From Artifact [d33c17b312]:

To Artifact [0e35e8f120]:


350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374

375
376
377
378
379
**
** Generate a ZIP archive for the baseline.
** Return that ZIP archive as the HTTP reply content.
*/
void baseline_zip_page(void){
  int rid;
  char *zName;
  int i;
  Blob zip;

  login_check_credentials();
  if( !g.okRead || !g.okHistory ){ login_needed(); return; }
  zName = mprintf("%s", PD("name",""));
  i = strlen(zName);
  for(i=strlen(zName)-1; i>5; i--){
    if( zName[i]=='.' ){
      zName[i] = 0;
      break;
    }
  }
  rid = name_to_rid(zName);
  if( rid==0 ){
    @ Not found
    return;
  }

  zip_of_baseline(rid, &zip, zName);
  cgi_set_content(&zip);
  cgi_set_content_type("application/zip");
  cgi_reply();
}







|





|
|
|
|








>





350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
**
** Generate a ZIP archive for the baseline.
** Return that ZIP archive as the HTTP reply content.
*/
void baseline_zip_page(void){
  int rid;
  char *zName;
  int nName;
  Blob zip;

  login_check_credentials();
  if( !g.okRead || !g.okHistory ){ login_needed(); return; }
  zName = mprintf("%s", PD("name",""));
  nName = strlen(zName);
  for(nName=strlen(zName)-1; nName>5; nName--){
    if( zName[nName]=='.' ){
      zName[nName] = 0;
      break;
    }
  }
  rid = name_to_rid(zName);
  if( rid==0 ){
    @ Not found
    return;
  }
  if( nName>10 ) zName[10] = 0;
  zip_of_baseline(rid, &zip, zName);
  cgi_set_content(&zip);
  cgi_set_content_type("application/zip");
  cgi_reply();
}