[Xfce4-commits] <midori:master> Compare addon hostnames null-safely

Christian Dywan noreply at xfce.org
Sat Nov 19 00:00:02 CET 2011


Updating branch refs/heads/master
         to 82323c43a0beb89c0ba8c9540f80ad2bdadb9c71 (commit)
       from 963747523e56d0d288aca5a311625f08a1924b4b (commit)

commit 82323c43a0beb89c0ba8c9540f80ad2bdadb9c71
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Nov 18 23:57:56 2011 +0100

    Compare addon hostnames null-safely

 extensions/addons.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/extensions/addons.c b/extensions/addons.c
index eb2d23f..f0dc8c9 100644
--- a/extensions/addons.c
+++ b/extensions/addons.c
@@ -118,7 +118,7 @@ addons_install_response (GtkWidget*  infobar,
                 folder = "scripts";
             else if (g_str_has_suffix (uri, ".user.css"))
                 folder = "styles";
-            else if (!strcmp (hostname, "userscripts.org"))
+            else if (!g_strcmp0 (hostname, "userscripts.org"))
             {
                 /* http://userscripts.org/scripts/ACTION/SCRIPT_ID/NAME */
                 gchar* subpage = strchr (strchr (path + 1, '/') + 1, '/');
@@ -148,7 +148,7 @@ addons_install_response (GtkWidget*  infobar,
                     folder = "scripts";
                 }
             }
-            else if (!strcmp (hostname, "userstyles.org"))
+            else if (!g_strcmp0 (hostname, "userstyles.org"))
             {
                 /* http://userstyles.org/styles/STYLE_ID/NAME */
                 gchar* subpage = strchr (path + 1, '/');
@@ -260,14 +260,14 @@ addons_notify_load_status_cb (MidoriView*      view,
            {
                gchar* path;
                gchar* hostname = midori_uri_parse_hostname (uri, &path);
-               if (!strcmp (hostname, "userscripts.org")
+               if (!g_strcmp0 (hostname, "userscripts.org")
                 && (g_str_has_prefix (path, "/scripts/show/")
                  || g_str_has_prefix (path, "/scripts/review/")))
                {
                    /* Main (with desc) and "source view" pages */
                    addons_uri_install (view, ADDONS_USER_SCRIPTS);
                }
-               else if (!strcmp (hostname, "userstyles.org")
+               else if (!g_strcmp0 (hostname, "userstyles.org")
                 && g_str_has_prefix (path, "/styles/"))
                {
                    gchar* subpage = strchr (path + 1, '/');


More information about the Xfce4-commits mailing list