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.
This commit is contained in:
Tim Janik 2001-05-29 11:05:53 +00:00 committed by Tim Janik
parent 2d0ea4af6c
commit ba1c852a68
2 changed files with 16 additions and 2 deletions

View File

@ -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()

View File

@ -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)