Fossil SCM
Fix the goofy non-quoting of URL arguments to "start" on windows by including an extra quoted empty term. [forum:/forumpost/9600b10ffd0a7483|Forum post 9600b10ffd0a7483].
Commit
0d8c92882ae03ed3910044ea45f5f830acfcb4eda945d7df64252b9d2423df56
Parent
c72c6df46527511…
2 files changed
-7
+1
-1
-7
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -3072,18 +3072,11 @@ | ||
| 3072 | 3072 | }else if( strchr(zIpAddr,':') ){ |
| 3073 | 3073 | zBrowserArg = mprintf("http://[%s]:%%d/%s", zIpAddr, zInitPage); |
| 3074 | 3074 | }else{ |
| 3075 | 3075 | zBrowserArg = mprintf("http://%s:%%d/%s", zIpAddr, zInitPage); |
| 3076 | 3076 | } |
| 3077 | -#ifdef _WIN32 | |
| 3078 | - /* The "start" command on windows does not allow a URL to be quoted. | |
| 3079 | - ** So we have to depend on the fact that the URL is contructed in such | |
| 3080 | - ** a way that no quoting is needed. */ | |
| 3081 | - zBrowserCmd = mprintf("%s %s &", zBrowser, zBrowserArg); | |
| 3082 | -#else | |
| 3083 | 3077 | zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg); |
| 3084 | -#endif | |
| 3085 | 3078 | fossil_free(zBrowserArg); |
| 3086 | 3079 | } |
| 3087 | 3080 | if( zRemote ){ |
| 3088 | 3081 | /* If a USER@HOST:REPO argument is supplied, then use SSH to run |
| 3089 | 3082 | ** "fossil ui --nobrowser" on the remote system and to set up a |
| 3090 | 3083 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3072,18 +3072,11 @@ | |
| 3072 | }else if( strchr(zIpAddr,':') ){ |
| 3073 | zBrowserArg = mprintf("http://[%s]:%%d/%s", zIpAddr, zInitPage); |
| 3074 | }else{ |
| 3075 | zBrowserArg = mprintf("http://%s:%%d/%s", zIpAddr, zInitPage); |
| 3076 | } |
| 3077 | #ifdef _WIN32 |
| 3078 | /* The "start" command on windows does not allow a URL to be quoted. |
| 3079 | ** So we have to depend on the fact that the URL is contructed in such |
| 3080 | ** a way that no quoting is needed. */ |
| 3081 | zBrowserCmd = mprintf("%s %s &", zBrowser, zBrowserArg); |
| 3082 | #else |
| 3083 | zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg); |
| 3084 | #endif |
| 3085 | fossil_free(zBrowserArg); |
| 3086 | } |
| 3087 | if( zRemote ){ |
| 3088 | /* If a USER@HOST:REPO argument is supplied, then use SSH to run |
| 3089 | ** "fossil ui --nobrowser" on the remote system and to set up a |
| 3090 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3072,18 +3072,11 @@ | |
| 3072 | }else if( strchr(zIpAddr,':') ){ |
| 3073 | zBrowserArg = mprintf("http://[%s]:%%d/%s", zIpAddr, zInitPage); |
| 3074 | }else{ |
| 3075 | zBrowserArg = mprintf("http://%s:%%d/%s", zIpAddr, zInitPage); |
| 3076 | } |
| 3077 | zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg); |
| 3078 | fossil_free(zBrowserArg); |
| 3079 | } |
| 3080 | if( zRemote ){ |
| 3081 | /* If a USER@HOST:REPO argument is supplied, then use SSH to run |
| 3082 | ** "fossil ui --nobrowser" on the remote system and to set up a |
| 3083 |
+1
-1
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -833,11 +833,11 @@ | ||
| 833 | 833 | ** Return the name of a command that will launch a web-browser. |
| 834 | 834 | */ |
| 835 | 835 | const char *fossil_web_browser(void){ |
| 836 | 836 | const char *zBrowser = 0; |
| 837 | 837 | #if defined(_WIN32) |
| 838 | - zBrowser = db_get("web-browser", "start"); | |
| 838 | + zBrowser = db_get("web-browser", "start \"\""); | |
| 839 | 839 | #elif defined(__DARWIN__) || defined(__APPLE__) || defined(__HAIKU__) |
| 840 | 840 | zBrowser = db_get("web-browser", "open"); |
| 841 | 841 | #else |
| 842 | 842 | zBrowser = db_get("web-browser", 0); |
| 843 | 843 | if( zBrowser==0 ){ |
| 844 | 844 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | ** Return the name of a command that will launch a web-browser. |
| 834 | */ |
| 835 | const char *fossil_web_browser(void){ |
| 836 | const char *zBrowser = 0; |
| 837 | #if defined(_WIN32) |
| 838 | zBrowser = db_get("web-browser", "start"); |
| 839 | #elif defined(__DARWIN__) || defined(__APPLE__) || defined(__HAIKU__) |
| 840 | zBrowser = db_get("web-browser", "open"); |
| 841 | #else |
| 842 | zBrowser = db_get("web-browser", 0); |
| 843 | if( zBrowser==0 ){ |
| 844 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | ** Return the name of a command that will launch a web-browser. |
| 834 | */ |
| 835 | const char *fossil_web_browser(void){ |
| 836 | const char *zBrowser = 0; |
| 837 | #if defined(_WIN32) |
| 838 | zBrowser = db_get("web-browser", "start \"\""); |
| 839 | #elif defined(__DARWIN__) || defined(__APPLE__) || defined(__HAIKU__) |
| 840 | zBrowser = db_get("web-browser", "open"); |
| 841 | #else |
| 842 | zBrowser = db_get("web-browser", 0); |
| 843 | if( zBrowser==0 ){ |
| 844 |