Commit 98d5dea1 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

: Use only the wide character API here, too.

2006-12-28  Tor Lillqvist  <tml@novell.com>

	* glib/gutils.c (get_windows_directory_root): : Use only the wide
	character API here, too.
parent a45be29b
2006-12-28 Tor Lillqvist <tml@novell.com>
* glib/gutils.h (G_WIN32_DLLMAIN_FOR_DLL_NAME): Use only the wide
* glib/gutils.h (G_WIN32_DLLMAIN_FOR_DLL_NAME)
* glib/gutils.c (get_windows_directory_root): : Use only the wide
character API here, too.
* glib/gslice.c: Make it compile on Win32 without pthreads: Use a
......
......@@ -1415,18 +1415,24 @@ get_special_folder (int csidl)
static char *
get_windows_directory_root (void)
{
char windowsdir[MAX_PATH];
wchar_t wwindowsdir[MAX_PATH];
if (GetWindowsDirectory (windowsdir, sizeof (windowsdir)))
if (GetWindowsDirectoryW (wwindowsdir, G_N_ELEMENTS (wwindowsdir)))
{
/* Usually X:\Windows, but in terminal server environments
* might be an UNC path, AFAIK.
*/
char *p = (char *) g_path_skip_root (windowsdir);
char *windowsdir = g_utf16_to_utf8 (wwindowsdir, -1, NULL, NULL, NULL);
char *p;
if (windowsdir == NULL)
return g_strdup ("C:\\");
p = (char *) g_path_skip_root (windowsdir);
if (G_IS_DIR_SEPARATOR (p[-1]) && p[-2] != ':')
p--;
*p = '\0';
return g_strdup (windowsdir);
return windowsdir;
}
else
return g_strdup ("C:\\");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment