diff options
author | Tim Janik <timj@gtk.org> | 2001-05-29 11:05:53 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2001-05-29 11:05:53 +0000 |
commit | ba1c852a68ebcd83d7d8b4b96ba0f1696ef1df31 (patch) | |
tree | f66ef9ffdb04ebb9b2b82bd75658910381f2b606 /gmodule | |
parent | 2d0ea4af6c80cd988666bb4043965f270ea7fc07 (diff) |
erk, strconcat needs NULL as last arg. make sure we pass module name with
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.
Diffstat (limited to 'gmodule')
-rw-r--r-- | gmodule/ChangeLog | 5 | ||||
-rw-r--r-- | gmodule/gmodule.c | 13 |
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) |