Fossil SCM
Rename variable <var>g.zUrlSuffix</var> to <var>g.zRelReqURI</var> (Relative Request URI). Provide it to TH1 interpreter as <var></var>.
Commit
05e3fa76bee4003b8a10d90e6d3861f221f7391828e75493587bfea9ee3a91bc
Parent
5ce372ce4843a23…
2 files changed
+5
-5
+6
-6
+5
-5
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -179,12 +179,12 @@ | ||
| 179 | 179 | int fNoSync; /* Do not do an autosync ever. --nosync */ |
| 180 | 180 | int fIPv4; /* Use only IPv4, not IPv6. --ipv4 */ |
| 181 | 181 | char *zPath; /* Name of webpage being served */ |
| 182 | 182 | char *zExtra; /* Extra path information past the webpage name */ |
| 183 | 183 | char *zBaseURL; /* Full URL for the toplevel of the fossil tree */ |
| 184 | - const char *zUrlSuffix; /* Suffix of the URL including query string | |
| 185 | - zBaseUrl/zUrlSuffix == Full text of the URL being served */ | |
| 184 | + const char *zRelReqURI; /* Relative Request URI (includes QUERY_STRING) | |
| 185 | + zBaseUrl/zRelReqURI == Full text of the URL being served */ | |
| 186 | 186 | char *zHttpsURL; /* zBaseURL translated to https: */ |
| 187 | 187 | char *zTop; /* Parent directory of zPath */ |
| 188 | 188 | int nExtraURL; /* Extra bytes added to SCRIPT_NAME */ |
| 189 | 189 | const char *zExtRoot; /* Document root for the /ext sub-website */ |
| 190 | 190 | const char *zContentType; /* The content type of the input HTTP request */ |
| @@ -1417,13 +1417,13 @@ | ||
| 1417 | 1417 | fossil_free(z); |
| 1418 | 1418 | } |
| 1419 | 1419 | |
| 1420 | 1420 | zRU = PD("REQUEST_URI",""); |
| 1421 | 1421 | nTop = strlen( g.zTop ); |
| 1422 | - g.zUrlSuffix = strncmp(zRU,g.zTop,nTop) ? "" : zRU+nTop; | |
| 1423 | - if(g.zUrlSuffix[0]=='/') g.zUrlSuffix++; | |
| 1424 | - g.zUrlSuffix = fossil_strdup( g.zUrlSuffix ); | |
| 1422 | + g.zRelReqURI = strncmp(zRU,g.zTop,nTop) ? "" : zRU+nTop; | |
| 1423 | + if(g.zRelReqURI[0]=='/') g.zRelReqURI++; | |
| 1424 | + g.zRelReqURI = fossil_strdup( g.zRelReqURI ); | |
| 1425 | 1425 | |
| 1426 | 1426 | /* Try to record the base URL as a CONFIG table entry with a name |
| 1427 | 1427 | ** of the form: "baseurl:BASE". This keeps a record of how the |
| 1428 | 1428 | ** the repository is used as a server, to help in answering questions |
| 1429 | 1429 | ** like "where is the CGI script that references this repository?" |
| 1430 | 1430 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -179,12 +179,12 @@ | |
| 179 | int fNoSync; /* Do not do an autosync ever. --nosync */ |
| 180 | int fIPv4; /* Use only IPv4, not IPv6. --ipv4 */ |
| 181 | char *zPath; /* Name of webpage being served */ |
| 182 | char *zExtra; /* Extra path information past the webpage name */ |
| 183 | char *zBaseURL; /* Full URL for the toplevel of the fossil tree */ |
| 184 | const char *zUrlSuffix; /* Suffix of the URL including query string |
| 185 | zBaseUrl/zUrlSuffix == Full text of the URL being served */ |
| 186 | char *zHttpsURL; /* zBaseURL translated to https: */ |
| 187 | char *zTop; /* Parent directory of zPath */ |
| 188 | int nExtraURL; /* Extra bytes added to SCRIPT_NAME */ |
| 189 | const char *zExtRoot; /* Document root for the /ext sub-website */ |
| 190 | const char *zContentType; /* The content type of the input HTTP request */ |
| @@ -1417,13 +1417,13 @@ | |
| 1417 | fossil_free(z); |
| 1418 | } |
| 1419 | |
| 1420 | zRU = PD("REQUEST_URI",""); |
| 1421 | nTop = strlen( g.zTop ); |
| 1422 | g.zUrlSuffix = strncmp(zRU,g.zTop,nTop) ? "" : zRU+nTop; |
| 1423 | if(g.zUrlSuffix[0]=='/') g.zUrlSuffix++; |
| 1424 | g.zUrlSuffix = fossil_strdup( g.zUrlSuffix ); |
| 1425 | |
| 1426 | /* Try to record the base URL as a CONFIG table entry with a name |
| 1427 | ** of the form: "baseurl:BASE". This keeps a record of how the |
| 1428 | ** the repository is used as a server, to help in answering questions |
| 1429 | ** like "where is the CGI script that references this repository?" |
| 1430 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -179,12 +179,12 @@ | |
| 179 | int fNoSync; /* Do not do an autosync ever. --nosync */ |
| 180 | int fIPv4; /* Use only IPv4, not IPv6. --ipv4 */ |
| 181 | char *zPath; /* Name of webpage being served */ |
| 182 | char *zExtra; /* Extra path information past the webpage name */ |
| 183 | char *zBaseURL; /* Full URL for the toplevel of the fossil tree */ |
| 184 | const char *zRelReqURI; /* Relative Request URI (includes QUERY_STRING) |
| 185 | zBaseUrl/zRelReqURI == Full text of the URL being served */ |
| 186 | char *zHttpsURL; /* zBaseURL translated to https: */ |
| 187 | char *zTop; /* Parent directory of zPath */ |
| 188 | int nExtraURL; /* Extra bytes added to SCRIPT_NAME */ |
| 189 | const char *zExtRoot; /* Document root for the /ext sub-website */ |
| 190 | const char *zContentType; /* The content type of the input HTTP request */ |
| @@ -1417,13 +1417,13 @@ | |
| 1417 | fossil_free(z); |
| 1418 | } |
| 1419 | |
| 1420 | zRU = PD("REQUEST_URI",""); |
| 1421 | nTop = strlen( g.zTop ); |
| 1422 | g.zRelReqURI = strncmp(zRU,g.zTop,nTop) ? "" : zRU+nTop; |
| 1423 | if(g.zRelReqURI[0]=='/') g.zRelReqURI++; |
| 1424 | g.zRelReqURI = fossil_strdup( g.zRelReqURI ); |
| 1425 | |
| 1426 | /* Try to record the base URL as a CONFIG table entry with a name |
| 1427 | ** of the form: "baseurl:BASE". This keeps a record of how the |
| 1428 | ** the repository is used as a server, to help in answering questions |
| 1429 | ** like "where is the CGI script that references this repository?" |
| 1430 |
+6
-6
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -406,16 +406,16 @@ | ||
| 406 | 406 | va_end(ap); |
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | /* Use this for the $base_href_suffix variable if it is not NULL. |
| 411 | -** If it is NULL then use g.zUrlSuffix | |
| 411 | +** If it is NULL then use g.zRelReqURI | |
| 412 | 412 | */ |
| 413 | 413 | static char *local_zBaseHrefSuffix = 0; |
| 414 | 414 | |
| 415 | 415 | /* |
| 416 | -** Set the desired $base_href_suffix to something other than g.zUrlSuffix | |
| 416 | +** Set the desired $base_href_suffix to something other than g.zRelReqURI | |
| 417 | 417 | */ |
| 418 | 418 | void style_set_base_href_suffix(const char *zFormat, ...){ |
| 419 | 419 | fossil_free(local_zBaseHrefSuffix); |
| 420 | 420 | if( zFormat==0 ){ |
| 421 | 421 | local_zBaseHrefSuffix = 0; |
| @@ -790,15 +790,15 @@ | ||
| 790 | 790 | Th_Store("home", g.zTop); |
| 791 | 791 | Th_Store("index_page", db_get("index-page","/home")); |
| 792 | 792 | if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath); |
| 793 | 793 | Th_Store("current_page", local_zCurrentPage); |
| 794 | 794 | if( local_zBaseHrefSuffix==0 ){ |
| 795 | - style_set_base_href_suffix("%s",g.zUrlSuffix); | |
| 796 | - /* %s because g.zUrlSuffix is already encoded (FIXME: really so?) */ | |
| 795 | + style_set_base_href_suffix("%s",g.zRelReqURI); | |
| 796 | + /* %s because g.zRelReqURI is already encoded (FIXME: really so?) */ | |
| 797 | 797 | } |
| 798 | 798 | Th_Store("base_href_suffix", local_zBaseHrefSuffix); |
| 799 | - Th_Store("requested_url_suffix", g.zUrlSuffix); | |
| 799 | + Th_Store("relrequri", g.zRelReqURI); | |
| 800 | 800 | Th_Store("csrf_token", g.zCsrfToken); |
| 801 | 801 | Th_Store("release_version", RELEASE_VERSION); |
| 802 | 802 | Th_Store("manifest_version", MANIFEST_VERSION); |
| 803 | 803 | Th_Store("manifest_date", MANIFEST_DATE); |
| 804 | 804 | Th_Store("compiler_name", COMPILER_NAME); |
| @@ -1409,11 +1409,11 @@ | ||
| 1409 | 1409 | #if !defined(_WIN32) |
| 1410 | 1410 | @ uid=%d(getuid()), gid=%d(getgid())<br /> |
| 1411 | 1411 | #endif |
| 1412 | 1412 | @ g.zBaseURL = %h(g.zBaseURL)<br /> |
| 1413 | 1413 | @ g.zHttpsURL = %h(g.zHttpsURL)<br /> |
| 1414 | - @ g.zUrlSuffix = %h(g.zUrlSuffix)<br /> | |
| 1414 | + @ g.zRelReqURI = %h(g.zRelReqURI)<br /> | |
| 1415 | 1415 | @ g.zTop = %h(g.zTop)<br /> |
| 1416 | 1416 | @ g.zPath = %h(g.zPath)<br /> |
| 1417 | 1417 | @ g.userUid = %d(g.userUid)<br /> |
| 1418 | 1418 | @ g.zLogin = %h(g.zLogin)<br /> |
| 1419 | 1419 | @ g.isHuman = %d(g.isHuman)<br /> |
| 1420 | 1420 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -406,16 +406,16 @@ | |
| 406 | va_end(ap); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | /* Use this for the $base_href_suffix variable if it is not NULL. |
| 411 | ** If it is NULL then use g.zUrlSuffix |
| 412 | */ |
| 413 | static char *local_zBaseHrefSuffix = 0; |
| 414 | |
| 415 | /* |
| 416 | ** Set the desired $base_href_suffix to something other than g.zUrlSuffix |
| 417 | */ |
| 418 | void style_set_base_href_suffix(const char *zFormat, ...){ |
| 419 | fossil_free(local_zBaseHrefSuffix); |
| 420 | if( zFormat==0 ){ |
| 421 | local_zBaseHrefSuffix = 0; |
| @@ -790,15 +790,15 @@ | |
| 790 | Th_Store("home", g.zTop); |
| 791 | Th_Store("index_page", db_get("index-page","/home")); |
| 792 | if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath); |
| 793 | Th_Store("current_page", local_zCurrentPage); |
| 794 | if( local_zBaseHrefSuffix==0 ){ |
| 795 | style_set_base_href_suffix("%s",g.zUrlSuffix); |
| 796 | /* %s because g.zUrlSuffix is already encoded (FIXME: really so?) */ |
| 797 | } |
| 798 | Th_Store("base_href_suffix", local_zBaseHrefSuffix); |
| 799 | Th_Store("requested_url_suffix", g.zUrlSuffix); |
| 800 | Th_Store("csrf_token", g.zCsrfToken); |
| 801 | Th_Store("release_version", RELEASE_VERSION); |
| 802 | Th_Store("manifest_version", MANIFEST_VERSION); |
| 803 | Th_Store("manifest_date", MANIFEST_DATE); |
| 804 | Th_Store("compiler_name", COMPILER_NAME); |
| @@ -1409,11 +1409,11 @@ | |
| 1409 | #if !defined(_WIN32) |
| 1410 | @ uid=%d(getuid()), gid=%d(getgid())<br /> |
| 1411 | #endif |
| 1412 | @ g.zBaseURL = %h(g.zBaseURL)<br /> |
| 1413 | @ g.zHttpsURL = %h(g.zHttpsURL)<br /> |
| 1414 | @ g.zUrlSuffix = %h(g.zUrlSuffix)<br /> |
| 1415 | @ g.zTop = %h(g.zTop)<br /> |
| 1416 | @ g.zPath = %h(g.zPath)<br /> |
| 1417 | @ g.userUid = %d(g.userUid)<br /> |
| 1418 | @ g.zLogin = %h(g.zLogin)<br /> |
| 1419 | @ g.isHuman = %d(g.isHuman)<br /> |
| 1420 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -406,16 +406,16 @@ | |
| 406 | va_end(ap); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | /* Use this for the $base_href_suffix variable if it is not NULL. |
| 411 | ** If it is NULL then use g.zRelReqURI |
| 412 | */ |
| 413 | static char *local_zBaseHrefSuffix = 0; |
| 414 | |
| 415 | /* |
| 416 | ** Set the desired $base_href_suffix to something other than g.zRelReqURI |
| 417 | */ |
| 418 | void style_set_base_href_suffix(const char *zFormat, ...){ |
| 419 | fossil_free(local_zBaseHrefSuffix); |
| 420 | if( zFormat==0 ){ |
| 421 | local_zBaseHrefSuffix = 0; |
| @@ -790,15 +790,15 @@ | |
| 790 | Th_Store("home", g.zTop); |
| 791 | Th_Store("index_page", db_get("index-page","/home")); |
| 792 | if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath); |
| 793 | Th_Store("current_page", local_zCurrentPage); |
| 794 | if( local_zBaseHrefSuffix==0 ){ |
| 795 | style_set_base_href_suffix("%s",g.zRelReqURI); |
| 796 | /* %s because g.zRelReqURI is already encoded (FIXME: really so?) */ |
| 797 | } |
| 798 | Th_Store("base_href_suffix", local_zBaseHrefSuffix); |
| 799 | Th_Store("relrequri", g.zRelReqURI); |
| 800 | Th_Store("csrf_token", g.zCsrfToken); |
| 801 | Th_Store("release_version", RELEASE_VERSION); |
| 802 | Th_Store("manifest_version", MANIFEST_VERSION); |
| 803 | Th_Store("manifest_date", MANIFEST_DATE); |
| 804 | Th_Store("compiler_name", COMPILER_NAME); |
| @@ -1409,11 +1409,11 @@ | |
| 1409 | #if !defined(_WIN32) |
| 1410 | @ uid=%d(getuid()), gid=%d(getgid())<br /> |
| 1411 | #endif |
| 1412 | @ g.zBaseURL = %h(g.zBaseURL)<br /> |
| 1413 | @ g.zHttpsURL = %h(g.zHttpsURL)<br /> |
| 1414 | @ g.zRelReqURI = %h(g.zRelReqURI)<br /> |
| 1415 | @ g.zTop = %h(g.zTop)<br /> |
| 1416 | @ g.zPath = %h(g.zPath)<br /> |
| 1417 | @ g.userUid = %d(g.userUid)<br /> |
| 1418 | @ g.zLogin = %h(g.zLogin)<br /> |
| 1419 | @ g.isHuman = %d(g.isHuman)<br /> |
| 1420 |