Fossil SCM

Attempt to fix quoting issues with the browser launch command on windows.

drh 2021-08-27 07:54 trunk
Commit c72c6df46527511b8d05542dc5f860db2b6419b7f93eb0bd13ab745ff857a8ba
2 files changed +1 -1 +3
+1 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -322,11 +322,11 @@
322322
fossil_print("<script>\n%s</script>\n", zJs);
323323
}
324324
fossil_print("%s", zWebpageEnd);
325325
}
326326
if( (diffFlags & DIFF_BROWSER)!=0 && nErr==0 ){
327
- char *zCmd = mprintf("%$ %$", fossil_web_browser(), tempDiffFilename);
327
+ char *zCmd = mprintf("%s %$", fossil_web_browser(), tempDiffFilename);
328328
fclose(diffOut);
329329
diffOut = freopen(NULL_DEVICE, "wb", stdout);
330330
fossil_system(zCmd);
331331
fossil_free(zCmd);
332332
diffOut = 0;
333333
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -322,11 +322,11 @@
322 fossil_print("<script>\n%s</script>\n", zJs);
323 }
324 fossil_print("%s", zWebpageEnd);
325 }
326 if( (diffFlags & DIFF_BROWSER)!=0 && nErr==0 ){
327 char *zCmd = mprintf("%$ %$", fossil_web_browser(), tempDiffFilename);
328 fclose(diffOut);
329 diffOut = freopen(NULL_DEVICE, "wb", stdout);
330 fossil_system(zCmd);
331 fossil_free(zCmd);
332 diffOut = 0;
333
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -322,11 +322,11 @@
322 fossil_print("<script>\n%s</script>\n", zJs);
323 }
324 fossil_print("%s", zWebpageEnd);
325 }
326 if( (diffFlags & DIFF_BROWSER)!=0 && nErr==0 ){
327 char *zCmd = mprintf("%s %$", fossil_web_browser(), tempDiffFilename);
328 fclose(diffOut);
329 diffOut = freopen(NULL_DEVICE, "wb", stdout);
330 fossil_system(zCmd);
331 fossil_free(zCmd);
332 diffOut = 0;
333
+3
--- src/main.c
+++ src/main.c
@@ -3073,10 +3073,13 @@
30733073
zBrowserArg = mprintf("http://[%s]:%%d/%s", zIpAddr, zInitPage);
30743074
}else{
30753075
zBrowserArg = mprintf("http://%s:%%d/%s", zIpAddr, zInitPage);
30763076
}
30773077
#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. */
30783081
zBrowserCmd = mprintf("%s %s &", zBrowser, zBrowserArg);
30793082
#else
30803083
zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg);
30813084
#endif
30823085
fossil_free(zBrowserArg);
30833086
--- src/main.c
+++ src/main.c
@@ -3073,10 +3073,13 @@
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 zBrowserCmd = mprintf("%s %s &", zBrowser, zBrowserArg);
3079 #else
3080 zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg);
3081 #endif
3082 fossil_free(zBrowserArg);
3083
--- src/main.c
+++ src/main.c
@@ -3073,10 +3073,13 @@
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

Keyboard Shortcuts

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