[libpeas] Don't try to open a directory as a .plugin



commit ba06534958aac190e15bcc63c36fd7ee42ca34b8
Author: Garrett Regier <alias301 gmail com>
Date:   Tue Feb 15 01:58:54 2011 -0800

    Don't try to open a directory as a .plugin
    
    This prevents directories with a .plugin suffix to
    be opened as if they were .plugin files.

 libpeas/peas-engine.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 29ee6b2..987fb44 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -162,11 +162,15 @@ load_dir_real (PeasEngine  *engine,
     {
       gchar *filename = g_build_filename (module_dir, dirent, NULL);
 
-      if (g_str_has_suffix (dirent, ".plugin"))
-        load_plugin_info (engine, filename, module_dir, data_dir);
-
-      else if (recursions > 0 && g_file_test (filename, G_FILE_TEST_IS_DIR))
-        load_dir_real (engine, filename, data_dir, recursions - 1);
+      if (g_file_test (filename, G_FILE_TEST_IS_DIR))
+        {
+          if (recursions > 0)
+            load_dir_real (engine, filename, data_dir, recursions - 1);
+        }
+      else if (g_str_has_suffix (dirent, ".plugin"))
+        {
+          load_plugin_info (engine, filename, module_dir, data_dir);
+        }
 
       g_free (filename);
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]