From 7f831646bb8c31966e0f3ff77d40ce66711daa99 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Thu, 26 Jul 2012 16:19:45 +0200 Subject: Autoload local plugins from /plugins --- src/common/plugin.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/common/plugin.c b/src/common/plugin.c index d8211e82..1bec7a7a 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -458,18 +458,30 @@ void plugin_auto_load (session *sess) { ps = sess; + + /* let's do it the Perl way */ + const char *xdir; + char *sub_dir; + + xdir = get_xdir_fs (); + sub_dir = malloc (strlen (xdir) + 9); + strcpy (sub_dir, xdir); + strcat (sub_dir, "/plugins"); + #ifdef WIN32 for_files ("./plugins", "*.dll", plugin_auto_load_cb); - for_files (get_xdir_fs (), "*.dll", plugin_auto_load_cb); + for_files (sub_dir, "*.dll", plugin_auto_load_cb); #else #if defined(__hpux) for_files (HEXCHATLIBDIR"/plugins", "*.sl", plugin_auto_load_cb); - for_files (get_xdir_fs (), "*.sl", plugin_auto_load_cb); + for_files (sub_dir, "*.sl", plugin_auto_load_cb); #else for_files (HEXCHATLIBDIR"/plugins", "*.so", plugin_auto_load_cb); - for_files (get_xdir_fs (), "*.so", plugin_auto_load_cb); + for_files (sub_dir, "*.so", plugin_auto_load_cb); #endif #endif + + free (sub_dir); } #endif -- cgit 1.4.1