Public bug reported:

Hello, I looked a bit at xchat's code for some debugging reasons, and I
have found that the browser patch
(xchat-2.6.6/debian/patches/09_browser.dpatch) has some redundant code.

The portion in question is:

--- xchat-2.6.4foo/src/fe-gtk/fe-gtk.c  2006-06-06 03:03:11.000000000 +0200
+++ xchat-2.6.4/src/fe-gtk/fe-gtk.c     2006-06-23 22:48:30.000000000 +0200
@@ -840,7 +840,7 @@
        char tbuf[512], *moz;
 
        /* gnome 2.4+ has this */
-       moz = g_find_program_in_path ("gnome-open");
+       moz = g_find_program_in_path ("sensible-browser");
        if (moz)
        {
                snprintf (tbuf, sizeof (tbuf), "%s %s", moz, url);
@@ -849,14 +849,14 @@
                return;
        }
 
-       moz = g_find_program_in_path ("firefox");
+       moz = g_find_program_in_path ("sensible-browser");
        if (moz)
        {
                snprintf (tbuf, sizeof (tbuf), "%s %s", moz, url);
                g_free (moz);
        } else
        {
-               snprintf (tbuf, sizeof (tbuf), "mozilla -remote 'openURL(%s)'", 
url);
+               snprintf (tbuf, sizeof (tbuf), "sensible-browser '%s'", url);
        }
        xchat_exec (tbuf);
 #endif

As you can see, it will check two times for "sensible-browser" and if it
fails, it will still use it... The function could probably be rewritten
like that:

static void
fe_open_url_locale (const char *url)
{
#ifdef WIN32
        ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
#else
        char tbuf[512], *moz;

        moz = g_find_program_in_path ("sensible-browser");
        if (moz)
        {
                snprintf (tbuf, sizeof (tbuf), "%s %s", moz, url);
                g_free (moz);
                xchat_exec (tbuf);
                return;
        }
#endif
}

Sorry for not sending a real patch, I'm not very familiar with all that
yet.

** Affects: xchat (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
browser patch improvement
https://launchpad.net/bugs/69065

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to