mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +01:00
Don't call g_path_skip_root() unless the path is absolute.
2005-12-01 Tor Lillqvist <tml@novell.com> * glib/gstdio.c (g_stat): Don't call g_path_skip_root() unless the path is absolute.
This commit is contained in:
parent
cbe09f0312
commit
4d4156db1b
@ -599,7 +599,8 @@ g_stat (const gchar *filename,
|
|||||||
len = wcslen (wfilename);
|
len = wcslen (wfilename);
|
||||||
while (len > 0 && G_IS_DIR_SEPARATOR (wfilename[len-1]))
|
while (len > 0 && G_IS_DIR_SEPARATOR (wfilename[len-1]))
|
||||||
len--;
|
len--;
|
||||||
if (len > g_path_skip_root (filename) - filename)
|
if (len > 0 &&
|
||||||
|
(!g_path_is_absolute (filename) || len > g_path_skip_root (filename) - filename))
|
||||||
wfilename[len] = '\0';
|
wfilename[len] = '\0';
|
||||||
|
|
||||||
retval = _wstat (wfilename, (struct _stat *) buf);
|
retval = _wstat (wfilename, (struct _stat *) buf);
|
||||||
@ -626,7 +627,8 @@ g_stat (const gchar *filename,
|
|||||||
len = strlen (cp_filename);
|
len = strlen (cp_filename);
|
||||||
while (len > 0 && G_IS_DIR_SEPARATOR (cp_filename[len-1]))
|
while (len > 0 && G_IS_DIR_SEPARATOR (cp_filename[len-1]))
|
||||||
len--;
|
len--;
|
||||||
if (len > g_path_skip_root (filename) - filename)
|
if (len > 0 &&
|
||||||
|
(!g_path_is_absolute (filename) || len > g_path_skip_root (filename) - filename))
|
||||||
cp_filename[len] = '\0';
|
cp_filename[len] = '\0';
|
||||||
|
|
||||||
retval = stat (cp_filename, buf);
|
retval = stat (cp_filename, buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user