Kouhei Sutou
kous****@users*****
2007年 2月 15日 (木) 20:49:05 JST
Index: tomoe/lib/tomoe-module.c diff -u tomoe/lib/tomoe-module.c:1.10 tomoe/lib/tomoe-module.c:1.11 --- tomoe/lib/tomoe-module.c:1.10 Wed Dec 27 15:50:45 2006 +++ tomoe/lib/tomoe-module.c Thu Feb 15 20:49:05 2007 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-module.c,v 1.10 2006/12/27 06:50:45 kous Exp $ + * $Id: tomoe-module.c,v 1.11 2007/02/15 11:49:05 kous Exp $ */ #include <stdlib.h> @@ -288,12 +288,18 @@ static TomoeModule * _tomoe_module_load (const gchar *base_dir, const gchar *name) { - gchar *mod_path; + gchar *mod_base_name, *mod_path; TomoeModule *module = NULL; - mod_path = g_module_build_path (base_dir, name); - if (g_str_has_suffix (mod_path, G_MODULE_SUFFIX) && - g_file_test (mod_path, G_FILE_TEST_EXISTS)) { + mod_base_name = g_build_filename (base_dir, name, NULL); + if (g_str_has_suffix (mod_base_name, G_MODULE_SUFFIX)) { + mod_path = mod_base_name; + } else { + mod_path = g_strconcat (mod_base_name, "." G_MODULE_SUFFIX, NULL); + g_free (mod_base_name); + } + + if (g_file_test (mod_path, G_FILE_TEST_EXISTS)) { TomoeModulePrivate *priv; module = g_object_new (TOMOE_TYPE_MODULE, NULL); priv = TOMOE_MODULE_GET_PRIVATE (module); @@ -335,7 +341,7 @@ gchar *module_base_name, *normalized_matched_name; module_base_name = g_path_get_basename (mod_path); - normalized_matched_name = g_module_build_path (NULL, name); + normalized_matched_name = g_strconcat (name, "." G_MODULE_SUFFIX, NULL); matched = (0 == strcmp (module_base_name, normalized_matched_name));