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.

drh 2016-08-21 17:50 trunk
Commit 253795692b31080d7430b2e8dc9a2014930eeec6
1 file changed +4
+4
--- src/doc.c
+++ src/doc.c
@@ -596,10 +596,11 @@
596596
zDfltTitle = isUV ? "" : "Documentation";
597597
db_begin_transaction();
598598
while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){
599599
zName = P("name");
600600
if( isUV ){
601
+ if( zName==0 ) zName = "";
601602
i = 0;
602603
}else{
603604
if( zName==0 || zName[0]==0 ) zName = "tip/index.wiki";
604605
for(i=0; zName[i] && zName[i]!='/'; i++){}
605606
zCheckin = mprintf("%.*s", i, zName);
@@ -725,10 +726,13 @@
725726
return;
726727
727728
/* Jump here when unable to locate the document */
728729
doc_not_found:
729730
db_end_transaction(0);
731
+ if( isUV && P("name")==0 ){
732
+ return uvstat_page();
733
+ }
730734
cgi_set_status(404, "Not Found");
731735
style_header("Not Found");
732736
@ <p>Document %h(zOrigName) not found
733737
if( fossil_strcmp(zCheckin,"ckout")!=0 ){
734738
@ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
735739
--- 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

Keyboard Shortcuts

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