Fossil SCM

Fix compiler warning for 'zOrigName' variable. If unable to locate a document, fallback on 'zName' if 'zOrigName' is zero.

mistachkin 2015-01-23 07:03 UTC trunk
Commit aed9971ddb3a713d004d1607f4565081036d519a
1 file changed +2 -2
+2 -2
--- src/doc.c
+++ src/doc.c
@@ -378,11 +378,11 @@
378378
**
379379
** The file extension is used to decide how to render the file.
380380
*/
381381
void doc_page(void){
382382
const char *zName; /* Argument to the /doc page */
383
- const char *zOrigName; /* Original document name */
383
+ const char *zOrigName = 0; /* Original document name */
384384
const char *zMime; /* Document MIME type */
385385
char *zCheckin; /* The checkin holding the document */
386386
int vid = 0; /* Artifact of checkin */
387387
int rid = 0; /* Artifact of file */
388388
int i; /* Loop counter */
@@ -523,11 +523,11 @@
523523
/* Jump here when unable to locate the document */
524524
doc_not_found:
525525
db_end_transaction(0);
526526
cgi_set_status(404, "Not Found");
527527
style_header("Not Found");
528
- @ <p>Document %h(zOrigName) not found
528
+ @ <p>Document %h(zOrigName ? zOrigName : zName) not found
529529
if( fossil_strcmp(zCheckin,"ckout")!=0 ){
530530
@ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
531531
}
532532
style_footer();
533533
return;
534534
--- src/doc.c
+++ src/doc.c
@@ -378,11 +378,11 @@
378 **
379 ** The file extension is used to decide how to render the file.
380 */
381 void doc_page(void){
382 const char *zName; /* Argument to the /doc page */
383 const char *zOrigName; /* Original document name */
384 const char *zMime; /* Document MIME type */
385 char *zCheckin; /* The checkin holding the document */
386 int vid = 0; /* Artifact of checkin */
387 int rid = 0; /* Artifact of file */
388 int i; /* Loop counter */
@@ -523,11 +523,11 @@
523 /* Jump here when unable to locate the document */
524 doc_not_found:
525 db_end_transaction(0);
526 cgi_set_status(404, "Not Found");
527 style_header("Not Found");
528 @ <p>Document %h(zOrigName) not found
529 if( fossil_strcmp(zCheckin,"ckout")!=0 ){
530 @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
531 }
532 style_footer();
533 return;
534
--- src/doc.c
+++ src/doc.c
@@ -378,11 +378,11 @@
378 **
379 ** The file extension is used to decide how to render the file.
380 */
381 void doc_page(void){
382 const char *zName; /* Argument to the /doc page */
383 const char *zOrigName = 0; /* Original document name */
384 const char *zMime; /* Document MIME type */
385 char *zCheckin; /* The checkin holding the document */
386 int vid = 0; /* Artifact of checkin */
387 int rid = 0; /* Artifact of file */
388 int i; /* Loop counter */
@@ -523,11 +523,11 @@
523 /* Jump here when unable to locate the document */
524 doc_not_found:
525 db_end_transaction(0);
526 cgi_set_status(404, "Not Found");
527 style_header("Not Found");
528 @ <p>Document %h(zOrigName ? zOrigName : zName) not found
529 if( fossil_strcmp(zCheckin,"ckout")!=0 ){
530 @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
531 }
532 style_footer();
533 return;
534

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button