diff src/module.c @ 3630:9682c0e022c6

[gaim-migrate @ 3753] Yeah this will probably break a lot of shit knowing my luck. But hey, I really don't care what people thnk. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 11 Oct 2002 03:14:01 +0000
parents bdd0bebd2d04
children 988485669631
line wrap: on
line diff
--- a/src/module.c	Fri Oct 11 02:10:08 2002 +0000
+++ b/src/module.c	Fri Oct 11 03:14:01 2002 +0000
@@ -47,6 +47,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#ifdef _WIN32
+#include "win32dep.h"
+#endif
+
 /* ------------------ Global Variables ----------------------- */
 
 GList *plugins = NULL;
@@ -88,8 +92,7 @@
 	gchar *path;
 	struct gaim_plugin_description *plugdes;
 	struct gaim_plugin *plug;
-	char userspace[128];
-	char *probedirs[] = {LIBDIR, &userspace, 0};
+	char *probedirs[3];
 	int l;
 #if GAIM_PLUGINS     
 	char *(*gaim_plugin_init)(GModule *);
@@ -100,14 +103,22 @@
 	GModule *handle;
 #endif
 
-	g_snprintf(userspace, sizeof(userspace), "%s" G_DIR_SEPARATOR_S ".gaim", g_get_home_dir());
+	probedirs[0] = LIBDIR;
+	probedirs[1] = gaim_user_dir();
+	probedirs[2] = 0;
 
 	for (l=0; probedirs[l]; l++) {
 		dir = g_dir_open(probedirs[l], 0, NULL);
 		if (dir) {
 			while ((file = g_dir_read_name(dir))) {
 #ifdef GAIM_PLUGINS
-				if (is_so_file(file, ".so") && g_module_supported()) {
+				if (is_so_file(file, 
+#ifndef _WIN32
+					       ".so"
+#else
+					       ".dll"
+#endif
+					       ) && g_module_supported()) {
 					path = g_build_filename(probedirs[l], file, NULL);
 					handle = g_module_open(path, 0);
 					if (!handle) {