[Xfce4-commits] <midori:master> Test extension file suffix after stripping key

Christian Dywan noreply at xfce.org
Sat Mar 30 00:38:02 CET 2013


Updating branch refs/heads/master
         to 26e004f90c0703fc4caf7837aa7132c2c9f1e1e3 (commit)
       from 5162f1395e72c8f5d8216c10d831c6bdadd63962 (commit)

commit 26e004f90c0703fc4caf7837aa7132c2c9f1e1e3
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Mar 30 00:35:38 2013 +0100

    Test extension file suffix after stripping key
    
    For example libexternal-download-manager.so/commandline

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

diff --git a/midori/midori-extension.c b/midori/midori-extension.c
index 92c6bb7..63688f2 100644
--- a/midori/midori-extension.c
+++ b/midori/midori-extension.c
@@ -585,10 +585,6 @@ midori_extension_load_from_file (const gchar* extension_path,
     g_return_val_if_fail (extension_path != NULL, NULL);
     g_return_val_if_fail (filename != NULL, NULL);
 
-    /* Ignore files which don't have the correct suffix */
-    if (!g_str_has_suffix (filename, G_MODULE_SUFFIX))
-        return NULL;
-
     if (strchr (filename, '/'))
     {
         gchar* clean = g_strndup (filename, strchr (filename, '/') - filename);
@@ -598,6 +594,10 @@ midori_extension_load_from_file (const gchar* extension_path,
     else
         fullname = g_build_filename (extension_path, filename, NULL);
 
+    /* Ignore files which don't have the correct suffix */
+    if (!g_str_has_suffix (fullname, G_MODULE_SUFFIX))
+        return NULL;
+
     module = g_module_open (fullname, G_MODULE_BIND_LOCAL);
     g_free (fullname);
 


More information about the Xfce4-commits mailing list