GLocalFile: canonicalize the initial directory separator

GLocalFile was (in certain situations) translating a path like
"/foo/bar/baz" to "/foo\bar\baz" on win32. Fix it to make sure the
initial directory separator gets canonicalized too.

Fixes gio/tests/g-icon on win32.

https://bugzilla.gnome.org/show_bug.cgi?id=688109
This commit is contained in:
Dan Winship 2012-11-10 11:09:18 -05:00
parent f80d8f1e4d
commit 468a166711

View File

@ -230,6 +230,11 @@ canonicalize_filename (const char *filename)
memmove (start, start+i, strlen (start+i)+1); memmove (start, start+i, strlen (start+i)+1);
} }
/* Make sure we're using the canonical dir separator */
p++;
while (p < start && G_IS_DIR_SEPARATOR (*p))
*p++ = G_DIR_SEPARATOR;
p = start; p = start;
while (*p != 0) while (*p != 0)
{ {