Fossil

Check-in [aed9971ddb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix compiler warning for 'zOrigName' variable. If unable to locate a document, fallback on 'zName' if 'zOrigName' is zero.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | docVarWarn
Files: files | file ages | folders
SHA1: aed9971ddb3a713d004d1607f4565081036d519a
User & Date: mistachkin 2015-01-23 07:03:00.950
Context
2015-01-23
07:03
Fix compiler warning for 'zOrigName' variable. If unable to locate a document, fallback on 'zName' if 'zOrigName' is zero. Closed-Leaf check-in: aed9971ddb user: mistachkin tags: docVarWarn
05:49
Fix build issue for MinGW due to missing 'ws2tcpip.h' functions. check-in: 4c247512a8 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/doc.c.
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
** for looking at what a file will look like using the /doc webpage after
** it gets checked in.
**
** The file extension is used to decide how to render the file.
*/
void doc_page(void){
  const char *zName;                /* Argument to the /doc page */
  const char *zOrigName;            /* Original document name */
  const char *zMime;                /* Document MIME type */
  char *zCheckin;                   /* The checkin holding the document */
  int vid = 0;                      /* Artifact of checkin */
  int rid = 0;                      /* Artifact of file */
  int i;                            /* Loop counter */
  Blob filebody;                    /* Content of the documentation file */
  int nMiss = 0;                    /* Failed attempts to find the document */







|







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
** for looking at what a file will look like using the /doc webpage after
** it gets checked in.
**
** The file extension is used to decide how to render the file.
*/
void doc_page(void){
  const char *zName;                /* Argument to the /doc page */
  const char *zOrigName = 0;        /* Original document name */
  const char *zMime;                /* Document MIME type */
  char *zCheckin;                   /* The checkin holding the document */
  int vid = 0;                      /* Artifact of checkin */
  int rid = 0;                      /* Artifact of file */
  int i;                            /* Loop counter */
  Blob filebody;                    /* Content of the documentation file */
  int nMiss = 0;                    /* Failed attempts to find the document */
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
  return;

  /* Jump here when unable to locate the document */
doc_not_found:
  db_end_transaction(0);
  cgi_set_status(404, "Not Found");
  style_header("Not Found");
  @ <p>Document %h(zOrigName) not found
  if( fossil_strcmp(zCheckin,"ckout")!=0 ){
    @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
  }
  style_footer();
  return;
}








|







521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
  return;

  /* Jump here when unable to locate the document */
doc_not_found:
  db_end_transaction(0);
  cgi_set_status(404, "Not Found");
  style_header("Not Found");
  @ <p>Document %h(zOrigName ? zOrigName : zName) not found
  if( fossil_strcmp(zCheckin,"ckout")!=0 ){
    @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
  }
  style_footer();
  return;
}