From 468a166711ab78986b3404909c6d9c0cf3633bea Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sat, 10 Nov 2012 11:09:18 -0500 Subject: [PATCH] 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 --- gio/glocalfile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gio/glocalfile.c b/gio/glocalfile.c index eca2a11ba..ae60870ad 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -229,6 +229,11 @@ canonicalize_filename (const char *filename) start -= i; 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; while (*p != 0) -- 2.34.1