Fossil

Check-in [0d8c92882a]
Login

Check-in [0d8c92882a]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0d8c92882ae03ed3910044ea45f5f830acfcb4eda945d7df64252b9d2423df56
User & Date: drh 2021-08-27 11:29:37.560
Context
2021-08-27
12:09
Add a missing #include to diffcmd.c so that the build will work under mingw32. ... (check-in: 00c8622a02 user: drh tags: trunk)
11:29
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]. ... (check-in: 0d8c92882a user: drh tags: trunk)
07:54
Attempt to fix quoting issues with the browser launch command on windows. ... (check-in: c72c6df465 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
    if( zIpAddr==0 ){
      zBrowserArg = mprintf("http://localhost:%%d/%s", zInitPage);
    }else if( strchr(zIpAddr,':') ){
      zBrowserArg = mprintf("http://[%s]:%%d/%s", zIpAddr, zInitPage);
    }else{
      zBrowserArg = mprintf("http://%s:%%d/%s", zIpAddr, zInitPage);
    }
#ifdef _WIN32
    /* The "start" command on windows does not allow a URL to be quoted.
    ** So we have to depend on the fact that the URL is contructed in such
    ** a way that no quoting is needed. */
    zBrowserCmd = mprintf("%s %s &", zBrowser, zBrowserArg);
#else
    zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg);
#endif
    fossil_free(zBrowserArg);
  }
  if( zRemote ){
    /* If a USER@HOST:REPO argument is supplied, then use SSH to run
    ** "fossil ui --nobrowser" on the remote system and to set up a
    ** tunnel from the local machine to the remote. */
    FILE *sshIn;







<
<
<
<
<
<

<







3070
3071
3072
3073
3074
3075
3076






3077

3078
3079
3080
3081
3082
3083
3084
    if( zIpAddr==0 ){
      zBrowserArg = mprintf("http://localhost:%%d/%s", zInitPage);
    }else if( strchr(zIpAddr,':') ){
      zBrowserArg = mprintf("http://[%s]:%%d/%s", zIpAddr, zInitPage);
    }else{
      zBrowserArg = mprintf("http://%s:%%d/%s", zIpAddr, zInitPage);
    }






    zBrowserCmd = mprintf("%s %!$ &", zBrowser, zBrowserArg);

    fossil_free(zBrowserArg);
  }
  if( zRemote ){
    /* If a USER@HOST:REPO argument is supplied, then use SSH to run
    ** "fossil ui --nobrowser" on the remote system and to set up a
    ** tunnel from the local machine to the remote. */
    FILE *sshIn;
Changes to src/util.c.
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845

/*
** Return the name of a command that will launch a web-browser.
*/
const char *fossil_web_browser(void){
  const char *zBrowser = 0;
#if defined(_WIN32)
  zBrowser = db_get("web-browser", "start");
#elif defined(__DARWIN__) || defined(__APPLE__) || defined(__HAIKU__)
  zBrowser = db_get("web-browser", "open");
#else
  zBrowser = db_get("web-browser", 0);
  if( zBrowser==0 ){
    static const char *const azBrowserProg[] =
        { "xdg-open", "gnome-open", "firefox", "google-chrome" };







|







831
832
833
834
835
836
837
838
839
840
841
842
843
844
845

/*
** Return the name of a command that will launch a web-browser.
*/
const char *fossil_web_browser(void){
  const char *zBrowser = 0;
#if defined(_WIN32)
  zBrowser = db_get("web-browser", "start \"\"");
#elif defined(__DARWIN__) || defined(__APPLE__) || defined(__HAIKU__)
  zBrowser = db_get("web-browser", "open");
#else
  zBrowser = db_get("web-browser", 0);
  if( zBrowser==0 ){
    static const char *const azBrowserProg[] =
        { "xdg-open", "gnome-open", "firefox", "google-chrome" };