Fossil SCM

The 'g.zHttpsURL' variable should be populated even when the --baseurl option is used.

mistachkin 2016-02-01 20:36 trunk merge
Commit 4110f52297205596b153176fc83fb77410ed7a89
1 file changed +7 -1
+7 -1
--- src/main.c
+++ src/main.c
@@ -1397,11 +1397,17 @@
13971397
13981398
if( g.zBaseURL!=0 ) return;
13991399
if( zAltBase ){
14001400
int i, n, c;
14011401
g.zTop = g.zBaseURL = mprintf("%s", zAltBase);
1402
- if( memcmp(g.zTop, "http://", 7)!=0 && memcmp(g.zTop,"https://",8)!=0 ){
1402
+ if( strncmp(g.zTop, "http://", 7)==0 ){
1403
+ /* it is HTTP, replace prefix with HTTPS. */
1404
+ g.zHttpsURL = mprintf("https://%s", &g.zTop[7]);
1405
+ }else if( strncmp(g.zTop, "https://", 8)==0 ){
1406
+ /* it is already HTTPS, use it. */
1407
+ g.zHttpsURL = mprintf("%s", g.zTop);
1408
+ }else{
14031409
fossil_fatal("argument to --baseurl should be 'http://host/path'"
14041410
" or 'https://host/path'");
14051411
}
14061412
for(i=n=0; (c = g.zTop[i])!=0; i++){
14071413
if( c=='/' ){
14081414
--- src/main.c
+++ src/main.c
@@ -1397,11 +1397,17 @@
1397
1398 if( g.zBaseURL!=0 ) return;
1399 if( zAltBase ){
1400 int i, n, c;
1401 g.zTop = g.zBaseURL = mprintf("%s", zAltBase);
1402 if( memcmp(g.zTop, "http://", 7)!=0 && memcmp(g.zTop,"https://",8)!=0 ){
 
 
 
 
 
 
1403 fossil_fatal("argument to --baseurl should be 'http://host/path'"
1404 " or 'https://host/path'");
1405 }
1406 for(i=n=0; (c = g.zTop[i])!=0; i++){
1407 if( c=='/' ){
1408
--- src/main.c
+++ src/main.c
@@ -1397,11 +1397,17 @@
1397
1398 if( g.zBaseURL!=0 ) return;
1399 if( zAltBase ){
1400 int i, n, c;
1401 g.zTop = g.zBaseURL = mprintf("%s", zAltBase);
1402 if( strncmp(g.zTop, "http://", 7)==0 ){
1403 /* it is HTTP, replace prefix with HTTPS. */
1404 g.zHttpsURL = mprintf("https://%s", &g.zTop[7]);
1405 }else if( strncmp(g.zTop, "https://", 8)==0 ){
1406 /* it is already HTTPS, use it. */
1407 g.zHttpsURL = mprintf("%s", g.zTop);
1408 }else{
1409 fossil_fatal("argument to --baseurl should be 'http://host/path'"
1410 " or 'https://host/path'");
1411 }
1412 for(i=n=0; (c = g.zTop[i])!=0; i++){
1413 if( c=='/' ){
1414

Keyboard Shortcuts

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