summaryrefslogtreecommitdiff
path: root/gmodule
diff options
context:
space:
mode:
Diffstat (limited to 'gmodule')
-rw-r--r--gmodule/ChangeLog5
-rw-r--r--gmodule/gmodule.c13
2 files changed, 16 insertions, 2 deletions
diff --git a/gmodule/ChangeLog b/gmodule/ChangeLog
index 7c6d0ae69..cab25eacb 100644
--- a/gmodule/ChangeLog
+++ b/gmodule/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 29 12:57:51 2001 Tim Janik <timj@gtk.org>
+
+ * gmodule.c (g_module_symbol): erk, strconcat needs NULL as last arg.
+ make sure we pass module name with suffix into backend open.
+
Mon May 28 20:19:25 2001 Tim Janik <timj@gtk.org>
* gmodule.c (g_module_open): as a last resort, if we can't access()
diff --git a/gmodule/gmodule.c b/gmodule/gmodule.c
index ba2d13c47..7f7cf28a8 100644
--- a/gmodule/gmodule.c
+++ b/gmodule/gmodule.c
@@ -346,7 +346,7 @@ g_module_open (const gchar *file_name,
/* try completing by appending libtool suffix */
if (!name)
{
- name = g_strconcat (file_name, ".la");
+ name = g_strconcat (file_name, ".la", NULL);
if (!g_file_test (name, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
{
g_free (name);
@@ -357,7 +357,16 @@ g_module_open (const gchar *file_name,
* it via library paths
*/
if (!name)
- name = g_strdup (file_name);
+ {
+ gchar *dot = strrchr (file_name, '.');
+ gchar *slash = strrchr (file_name, G_DIR_SEPARATOR);
+
+ /* make sure the name has a suffix */
+ if (!dot || dot < slash)
+ name = g_strconcat (file_name, "." G_MODULE_SUFFIX, NULL);
+ else
+ name = g_strdup (file_name);
+ }
/* ok, try loading the module */
if (name)