Fossil SCM
Fix the /uv page so that it correctly handles a missing "name". First it looks for "index.html", "index.wiki", "index.md" and "index.th1", then if none of those documents are found, it does the equivalent of /uvlist.
Commit
253795692b31080d7430b2e8dc9a2014930eeec6
Parent
6a73034e71d50b8…
1 file changed
+4
+4
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -596,10 +596,11 @@ | ||
| 596 | 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | 597 | db_begin_transaction(); |
| 598 | 598 | while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){ |
| 599 | 599 | zName = P("name"); |
| 600 | 600 | if( isUV ){ |
| 601 | + if( zName==0 ) zName = ""; | |
| 601 | 602 | i = 0; |
| 602 | 603 | }else{ |
| 603 | 604 | if( zName==0 || zName[0]==0 ) zName = "tip/index.wiki"; |
| 604 | 605 | for(i=0; zName[i] && zName[i]!='/'; i++){} |
| 605 | 606 | zCheckin = mprintf("%.*s", i, zName); |
| @@ -725,10 +726,13 @@ | ||
| 725 | 726 | return; |
| 726 | 727 | |
| 727 | 728 | /* Jump here when unable to locate the document */ |
| 728 | 729 | doc_not_found: |
| 729 | 730 | db_end_transaction(0); |
| 731 | + if( isUV && P("name")==0 ){ | |
| 732 | + return uvstat_page(); | |
| 733 | + } | |
| 730 | 734 | cgi_set_status(404, "Not Found"); |
| 731 | 735 | style_header("Not Found"); |
| 732 | 736 | @ <p>Document %h(zOrigName) not found |
| 733 | 737 | if( fossil_strcmp(zCheckin,"ckout")!=0 ){ |
| 734 | 738 | @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a> |
| 735 | 739 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -596,10 +596,11 @@ | |
| 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | db_begin_transaction(); |
| 598 | while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){ |
| 599 | zName = P("name"); |
| 600 | if( isUV ){ |
| 601 | i = 0; |
| 602 | }else{ |
| 603 | if( zName==0 || zName[0]==0 ) zName = "tip/index.wiki"; |
| 604 | for(i=0; zName[i] && zName[i]!='/'; i++){} |
| 605 | zCheckin = mprintf("%.*s", i, zName); |
| @@ -725,10 +726,13 @@ | |
| 725 | return; |
| 726 | |
| 727 | /* Jump here when unable to locate the document */ |
| 728 | doc_not_found: |
| 729 | db_end_transaction(0); |
| 730 | cgi_set_status(404, "Not Found"); |
| 731 | style_header("Not Found"); |
| 732 | @ <p>Document %h(zOrigName) not found |
| 733 | if( fossil_strcmp(zCheckin,"ckout")!=0 ){ |
| 734 | @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a> |
| 735 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -596,10 +596,11 @@ | |
| 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | db_begin_transaction(); |
| 598 | while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){ |
| 599 | zName = P("name"); |
| 600 | if( isUV ){ |
| 601 | if( zName==0 ) zName = ""; |
| 602 | i = 0; |
| 603 | }else{ |
| 604 | if( zName==0 || zName[0]==0 ) zName = "tip/index.wiki"; |
| 605 | for(i=0; zName[i] && zName[i]!='/'; i++){} |
| 606 | zCheckin = mprintf("%.*s", i, zName); |
| @@ -725,10 +726,13 @@ | |
| 726 | return; |
| 727 | |
| 728 | /* Jump here when unable to locate the document */ |
| 729 | doc_not_found: |
| 730 | db_end_transaction(0); |
| 731 | if( isUV && P("name")==0 ){ |
| 732 | return uvstat_page(); |
| 733 | } |
| 734 | cgi_set_status(404, "Not Found"); |
| 735 | style_header("Not Found"); |
| 736 | @ <p>Document %h(zOrigName) not found |
| 737 | if( fossil_strcmp(zCheckin,"ckout")!=0 ){ |
| 738 | @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a> |
| 739 |