changeset 13527:33dc57ccbd83

[gaim-migrate @ 15903] Prevent plugins that have more than one period in the name from being duplicated with every probe. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 20 Mar 2006 05:06:26 +0000
parents e79d8720de34
children fe9f41df4b0e
files src/plugin.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugin.c	Mon Mar 20 03:42:12 2006 +0000
+++ b/src/plugin.c	Mon Mar 20 05:06:26 2006 +0000
@@ -1208,6 +1208,7 @@
 			continue;
 
 		filename = f->data;
+
 		/*
 		 * We don't know if the filename uses Windows or Unix path
 		 * separators (because people might be sharing a prefs.xml
@@ -1220,6 +1221,9 @@
 		if (basename != NULL)
 			basename++;
 
+		/* Strip the extension */
+		basename = gaim_plugin_get_basename(basename);
+
 		if ((plugin = gaim_plugins_find_with_filename(filename)) != NULL)
 		{
 			gaim_debug_info("plugins", "Loading saved plugin %s\n",
@@ -1238,6 +1242,8 @@
 							 filename);
 		}
 
+		g_free(basename);
+
 		g_free(f->data);
 	}
 
@@ -1496,30 +1502,25 @@
 #ifdef GAIM_PLUGINS
 	GaimPlugin *plugin;
 	GList *l;
-	char *basename_no_ext;
 	char *tmp;
 
 	g_return_val_if_fail(basename != NULL, NULL);
 
-	basename_no_ext = gaim_plugin_get_basename(basename);
-
 	for (l = plugins; l != NULL; l = l->next)
 	{
 		plugin = (GaimPlugin *)l->data;
 
 		if (plugin->path != NULL) {
 			tmp = gaim_plugin_get_basename(plugin->path);
-			if (!strcmp(tmp, basename_no_ext))
+			if (!strcmp(tmp, basename))
 			{
 				g_free(tmp);
-				g_free(basename_no_ext);
 				return plugin;
 			}
 			g_free(tmp);
 		}
 	}
 
-	g_free(basename_no_ext);
 #endif /* GAIM_PLUGINS */
 
 	return NULL;