Fossil SCM

In set_base_url(), look at the second byte of the path from --baseurl only when there is a first, so that a base URL with no path is not read past its end.

dmestas 2026-11-20 21:52 UTC small-fixes
Commit 210e9def6f68dd34bacaf7ccf5a0d2fac7400d3ee93a545ca4f591c0bc9732f7
1 file changed +1 -1
+1 -1
--- src/main.c
+++ src/main.c
@@ -1455,11 +1455,11 @@
14551455
if( n==2 ) g.zTop = "";
14561456
if( g.zTop==g.zBaseURL ){
14571457
fossil_fatal("argument to --baseurl should be 'http://host/path'"
14581458
" or 'https://host/path'");
14591459
}
1460
- if( g.zTop[1]==0 ) g.zTop++;
1460
+ if( g.zTop[0] && g.zTop[1]==0 ) g.zTop++;
14611461
}else{
14621462
char *z;
14631463
zMode = PD("HTTPS","off");
14641464
zHost = PD("HTTP_HOST","");
14651465
z = fossil_strdup(zHost);
14661466
--- src/main.c
+++ src/main.c
@@ -1455,11 +1455,11 @@
1455 if( n==2 ) g.zTop = "";
1456 if( g.zTop==g.zBaseURL ){
1457 fossil_fatal("argument to --baseurl should be 'http://host/path'"
1458 " or 'https://host/path'");
1459 }
1460 if( g.zTop[1]==0 ) g.zTop++;
1461 }else{
1462 char *z;
1463 zMode = PD("HTTPS","off");
1464 zHost = PD("HTTP_HOST","");
1465 z = fossil_strdup(zHost);
1466
--- src/main.c
+++ src/main.c
@@ -1455,11 +1455,11 @@
1455 if( n==2 ) g.zTop = "";
1456 if( g.zTop==g.zBaseURL ){
1457 fossil_fatal("argument to --baseurl should be 'http://host/path'"
1458 " or 'https://host/path'");
1459 }
1460 if( g.zTop[0] && g.zTop[1]==0 ) g.zTop++;
1461 }else{
1462 char *z;
1463 zMode = PD("HTTPS","off");
1464 zHost = PD("HTTP_HOST","");
1465 z = fossil_strdup(zHost);
1466

Keyboard Shortcuts

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