+2004-11-04 Tor Lillqvist <tml@iki.fi>
+
+ * gmodule-win32.c (_g_module_open): Argument is in UTF-8. Use wide
+ character Win32 API if present.
+
+ * gmodule.c (parse_libtool_archive, g_module_open): Convert file
+ name to UTF-8 before storing in the error message string.
+
+ * gmodule.c (parse_libtool_archive): Use g_open().
+
2004-11-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.5 ===
cygwin_conv_to_win32_path(file_name, tmp);
file_name = tmp;
#endif
+ if (G_WIN32_HAVE_WIDECHAR_API ())
+ {
+ wchar_t *wfilename = g_utf8_to_utf16 (file_name, -1, NULL, NULL, NULL);
- handle = LoadLibrary (file_name);
+ handle = LoadLibraryW (wfilename);
+ g_free (wfilename);
+ }
+ else
+ {
+ gchar *cp_filename = g_locale_from_utf8 (file_name, -1, NULL, NULL, NULL);
+
+ handle = LoadLibraryA (cp_filename);
+ g_free (cp_filename);
+ }
+
if (!handle)
set_error ();
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+#include "gstdio.h"
#include "gmodule.h"
#include "gmoduleconf.h"
#include <errno.h>
GTokenType token;
GScanner *scanner;
- int fd = open (libtool_name, O_RDONLY, 0);
+ int fd = g_open (libtool_name, O_RDONLY, 0);
if (fd < 0)
{
- g_module_set_error_unduped (g_strdup_printf ("failed to open libtool archive \"%s\"", libtool_name));
+ gchar *display_libtool_name = g_filename_display_name (libtool_name);
+ g_module_set_error_unduped (g_strdup_printf ("failed to open libtool archive \"%s\"", display_libtool_name));
+ g_free (display_libtool_name);
return NULL;
}
/* search libtool's dlname specification */
(token == TOKEN_INSTALLED ?
G_TOKEN_IDENTIFIER : G_TOKEN_STRING))
{
- g_module_set_error_unduped (g_strdup_printf ("unable to parse libtool archive \"%s\"", libtool_name));
+ gchar *display_libtool_name = g_filename_display_name (libtool_name);
+ g_module_set_error_unduped (g_strdup_printf ("unable to parse libtool archive \"%s\"", display_libtool_name));
+ g_free (display_libtool_name);
g_free (lt_dlname);
g_free (lt_libdir);
(flags & G_MODULE_BIND_LOCAL) != 0);
}
else
- g_module_set_error_unduped (g_strdup_printf ("unable to access file \"%s\"", file_name));
+ {
+ gchar *display_file_name = g_filename_display_name (file_name);
+ g_module_set_error_unduped (g_strdup_printf ("unable to access file \"%s\"", display_file_name));
+ g_free (display_file_name);
+ }
g_free (name);
if (handle)