Fossil SCM
The 'g.zHttpsURL' variable should be populated even when the --baseurl option is used.
Commit
4110f52297205596b153176fc83fb77410ed7a89
Parent
b241130222d2ae7…
1 file changed
+7
-1
+7
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1397,11 +1397,17 @@ | ||
| 1397 | 1397 | |
| 1398 | 1398 | if( g.zBaseURL!=0 ) return; |
| 1399 | 1399 | if( zAltBase ){ |
| 1400 | 1400 | int i, n, c; |
| 1401 | 1401 | 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{ | |
| 1403 | 1409 | fossil_fatal("argument to --baseurl should be 'http://host/path'" |
| 1404 | 1410 | " or 'https://host/path'"); |
| 1405 | 1411 | } |
| 1406 | 1412 | for(i=n=0; (c = g.zTop[i])!=0; i++){ |
| 1407 | 1413 | if( c=='/' ){ |
| 1408 | 1414 |
| --- 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 |