From: Colin Leroy Date: Wed, 20 Feb 2013 15:21:48 +0000 (+0000) Subject: 2013-02-20 [colin] 3.9.0cvs93 X-Git-Tag: 3.9.1~102 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=9ec794b8fb3138be340c2e1436ac4a877928e6c8 2013-02-20 [colin] 3.9.0cvs93 * src/common/plugin.c Auto fix plugin names ending in "_plugin" --- diff --git a/ChangeLog b/ChangeLog index ae821dd2b..d8f05b326 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-02-20 [colin] 3.9.0cvs93 + + * src/common/plugin.c + Auto fix plugin names ending in "_plugin" + 2013-02-20 [colin] 3.9.0cvs92 * src/plugins/gdata/Makefile.am diff --git a/PATCHSETS b/PATCHSETS index 44bc7ea69..ed3a8135a 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -4590,3 +4590,4 @@ ( cvs diff -u -r 1.654.2.4666 -r 1.654.2.4667 configure.ac; ) > 3.9.0cvs90.patchset ( cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/fetchinfo/Makefile.am; cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/plugins/notification/Makefile.am; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/perl/Makefile.am; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/plugins/python/Makefile.am; ) > 3.9.0cvs91.patchset ( cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/gdata/Makefile.am; ) > 3.9.0cvs92.patchset +( cvs diff -u -r 1.13.2.48 -r 1.13.2.49 src/common/plugin.c; ) > 3.9.0cvs93.patchset diff --git a/configure.ac b/configure.ac index 71ffeca8f..7c77ac300 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=9 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=92 +EXTRA_VERSION=93 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/common/plugin.c b/src/common/plugin.c index 83db8e338..762a89a58 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -562,6 +562,28 @@ void plugin_unload(Plugin *plugin) } +static void replace_old_plugin_name(gchar *plugin_name) +{ + gchar *old_name_end = g_strconcat("_plugin.", G_MODULE_SUFFIX, NULL); + gchar *matches = strstr(plugin_name, old_name_end); + + if (!matches) { + g_free(old_name_end); + return; + } else if (plugin_name + strlen(plugin_name) != matches + strlen(matches)) { + g_free(old_name_end); + return; + } else { + gchar *new_name_end = g_strconcat(".", G_MODULE_SUFFIX, NULL); + int offset = strlen(plugin_name) - strlen(old_name_end); + + debug_print("Replacing old plugin name %s\n", plugin_name); + + strncpy(plugin_name + offset, new_name_end, strlen(old_name_end) - 1); + debug_print(" to %s\n", plugin_name); + } +} + void plugin_load_all(const gchar *type) { gchar *rcpath; @@ -591,6 +613,8 @@ void plugin_load_all(const gchar *type) break; g_strstrip(buf); + replace_old_plugin_name(buf); + if ((buf[0] != '\0') && (plugin_load(buf, &error) == NULL)) { g_warning("plugin loading error: %s\n", error); g_free(error);