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].

drh 2021-08-27 11:29 trunk
Commit 0d8c92882ae03ed3910044ea45f5f830acfcb4eda945d7df64252b9d2423df56
2 files changed -7 +1 -1
-7
--- src/main.c
+++ src/main.c
@@ -3072,18 +3072,11 @@
30723072
}else if( strchr(zIpAddr,':') ){
30733073
zBrowserArg = mprintf("http://[%s]:%%d/%s", zIpAddr, zInitPage);
30743074
}else{
30753075
zBrowserArg = mprintf("http://%s:%%d/%s", zIpAddr, zInitPage);
30763076
}
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
30833077
zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg);
3084
-#endif
30853078
fossil_free(zBrowserArg);
30863079
}
30873080
if( zRemote ){
30883081
/* If a USER@HOST:REPO argument is supplied, then use SSH to run
30893082
** "fossil ui --nobrowser" on the remote system and to set up a
30903083
--- 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 @@
833833
** Return the name of a command that will launch a web-browser.
834834
*/
835835
const char *fossil_web_browser(void){
836836
const char *zBrowser = 0;
837837
#if defined(_WIN32)
838
- zBrowser = db_get("web-browser", "start");
838
+ zBrowser = db_get("web-browser", "start \"\"");
839839
#elif defined(__DARWIN__) || defined(__APPLE__) || defined(__HAIKU__)
840840
zBrowser = db_get("web-browser", "open");
841841
#else
842842
zBrowser = db_get("web-browser", 0);
843843
if( zBrowser==0 ){
844844
--- 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

Keyboard Shortcuts

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