Fossil SCM
Fix compiler warning for 'zOrigName' variable. If unable to locate a document, fallback on 'zName' if 'zOrigName' is zero.
Commit
aed9971ddb3a713d004d1607f4565081036d519a
Parent
4c247512a8af92b…
1 file changed
+2
-2
+2
-2
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -378,11 +378,11 @@ | ||
| 378 | 378 | ** |
| 379 | 379 | ** The file extension is used to decide how to render the file. |
| 380 | 380 | */ |
| 381 | 381 | void doc_page(void){ |
| 382 | 382 | const char *zName; /* Argument to the /doc page */ |
| 383 | - const char *zOrigName; /* Original document name */ | |
| 383 | + const char *zOrigName = 0; /* Original document name */ | |
| 384 | 384 | const char *zMime; /* Document MIME type */ |
| 385 | 385 | char *zCheckin; /* The checkin holding the document */ |
| 386 | 386 | int vid = 0; /* Artifact of checkin */ |
| 387 | 387 | int rid = 0; /* Artifact of file */ |
| 388 | 388 | int i; /* Loop counter */ |
| @@ -523,11 +523,11 @@ | ||
| 523 | 523 | /* Jump here when unable to locate the document */ |
| 524 | 524 | doc_not_found: |
| 525 | 525 | db_end_transaction(0); |
| 526 | 526 | cgi_set_status(404, "Not Found"); |
| 527 | 527 | style_header("Not Found"); |
| 528 | - @ <p>Document %h(zOrigName) not found | |
| 528 | + @ <p>Document %h(zOrigName ? zOrigName : zName) not found | |
| 529 | 529 | if( fossil_strcmp(zCheckin,"ckout")!=0 ){ |
| 530 | 530 | @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a> |
| 531 | 531 | } |
| 532 | 532 | style_footer(); |
| 533 | 533 | return; |
| 534 | 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; /* 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 |