Fossil SCM

Make options --repolist and --baseurl work together, if the original URL doesn't end with '/'.

jan.nijtmans 2016-04-29 10:28 trunk
Commit 7c4628a568c01a11642e18c119c93aa1d85632ed
1 file changed +2 -1
+2 -1
--- src/main.c
+++ src/main.c
@@ -1588,10 +1588,11 @@
15881588
n = db_int(0, "SELECT count(*) FROM sfile");
15891589
if( n>0 ){
15901590
Stmt q;
15911591
@ <html>
15921592
@ <head>
1593
+ @ <base href="%s(g.zBaseURL)/" />
15931594
@ <title>Repository List</title>
15941595
@ </head>
15951596
@ <body>
15961597
@ <h1>Available Repositories:</h1>
15971598
@ <ol>
@@ -1598,11 +1599,11 @@
15981599
db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'"
15991600
" FROM sfile ORDER BY x COLLATE nocase;");
16001601
while( db_step(&q)==SQLITE_ROW ){
16011602
const char *zName = db_column_text(&q, 0);
16021603
const char *zUrl = db_column_text(&q, 1);
1603
- @ <li><a href="%h(zUrl)" target="_blank">%h(zName)</a></li>
1604
+ @ <li><a href="%R/%h(zUrl)" target="_blank">%h(zName)</a></li>
16041605
}
16051606
@ </ol>
16061607
@ </body>
16071608
@ </html>
16081609
cgi_reply();
16091610
--- src/main.c
+++ src/main.c
@@ -1588,10 +1588,11 @@
1588 n = db_int(0, "SELECT count(*) FROM sfile");
1589 if( n>0 ){
1590 Stmt q;
1591 @ <html>
1592 @ <head>
 
1593 @ <title>Repository List</title>
1594 @ </head>
1595 @ <body>
1596 @ <h1>Available Repositories:</h1>
1597 @ <ol>
@@ -1598,11 +1599,11 @@
1598 db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'"
1599 " FROM sfile ORDER BY x COLLATE nocase;");
1600 while( db_step(&q)==SQLITE_ROW ){
1601 const char *zName = db_column_text(&q, 0);
1602 const char *zUrl = db_column_text(&q, 1);
1603 @ <li><a href="%h(zUrl)" target="_blank">%h(zName)</a></li>
1604 }
1605 @ </ol>
1606 @ </body>
1607 @ </html>
1608 cgi_reply();
1609
--- src/main.c
+++ src/main.c
@@ -1588,10 +1588,11 @@
1588 n = db_int(0, "SELECT count(*) FROM sfile");
1589 if( n>0 ){
1590 Stmt q;
1591 @ <html>
1592 @ <head>
1593 @ <base href="%s(g.zBaseURL)/" />
1594 @ <title>Repository List</title>
1595 @ </head>
1596 @ <body>
1597 @ <h1>Available Repositories:</h1>
1598 @ <ol>
@@ -1598,11 +1599,11 @@
1599 db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'"
1600 " FROM sfile ORDER BY x COLLATE nocase;");
1601 while( db_step(&q)==SQLITE_ROW ){
1602 const char *zName = db_column_text(&q, 0);
1603 const char *zUrl = db_column_text(&q, 1);
1604 @ <li><a href="%R/%h(zUrl)" target="_blank">%h(zName)</a></li>
1605 }
1606 @ </ol>
1607 @ </body>
1608 @ </html>
1609 cgi_reply();
1610

Keyboard Shortcuts

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