mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-03 04:09:20 +02:00
Match also UNC paths on Win32.
2001-02-21 Tor Lillqvist <tml@iki.fi> * gutils.c (g_path_is_absolute): Match also UNC paths on Win32. * gthread.h: Include gtypes.h to be sure to get GLIB_VAR definition, remove definition from here. * gunicode.h: Remove duplicate GLIB_VAR definition from here, too. * gutils.c: (Win32) Use USERPROFILE as home dir if present. On Win2k, HOMEDRIVE and HOMEPATH aren't reliable. * Makefile.am (INCLUDES): Add -DGLIB_COMPILATION. * makefile.mingw.in: Remove install target, Windows isn't Unix. * testgdate.c * testgdateparser.c * testglib.c: Undefine GLIB_COMPILATION. * glib.def: Updates. * .cvsignore * */.cvsignore: Ignore also .obj, .dll, .lib and .exe files.
This commit is contained in:
committed by
Tor Lillqvist
parent
d1a05f990e
commit
cd89e4cca6
@@ -461,6 +461,9 @@ g_path_is_absolute (const gchar *file_name)
|
||||
#ifdef G_OS_WIN32
|
||||
if (isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR)
|
||||
return TRUE;
|
||||
|
||||
if (file_name[0] == G_DIR_SEPARATOR && file_name[1] == G_DIR_SEPARATOR)
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
@@ -727,11 +730,20 @@ g_get_any_init (void)
|
||||
while ((p = strchr (g_home_dir, '/')) != NULL)
|
||||
*p = '\\';
|
||||
}
|
||||
else
|
||||
|
||||
if (!g_home_dir)
|
||||
{
|
||||
/* The official way to specify a home directory on NT is
|
||||
* the HOMEDRIVE and HOMEPATH environment variables. At least
|
||||
* it was at some time.
|
||||
/* USERPROFILE is probably the closest equivalent to $HOME? */
|
||||
if (getenv ("USERPROFILE") != NULL)
|
||||
g_home_dir = g_getenv ("USERPROFILE");
|
||||
}
|
||||
|
||||
if (!g_home_dir)
|
||||
{
|
||||
/* At least at some time, HOMEDRIVE and HOMEPATH were used
|
||||
* to point to the home directory, I think. But on Windows
|
||||
* 2000 HOMEDRIVE seems to be equal to SYSTEMDRIVE, and
|
||||
* HOMEPATH is its root "\"?
|
||||
*/
|
||||
if (getenv ("HOMEDRIVE") != NULL && getenv ("HOMEPATH") != NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user