2009-01-19 Bill Holmes <billholmes54@gmail.com>
authorBill Holmes <holmes@mono-cvs.ximian.com>
Mon, 19 Jan 2009 13:58:19 +0000 (13:58 -0000)
committerBill Holmes <holmes@mono-cvs.ximian.com>
Mon, 19 Jan 2009 13:58:19 +0000 (13:58 -0000)
* mono-path.c (mono_path_canonicalize): Adding support for UNC
   paths on Windows.

Contributed under MIT/X11 license.

svn path=/trunk/mono/; revision=123795

mono/utils/ChangeLog
mono/utils/mono-path.c

index abdd675a14eee34047c7f1d4073618eb5db10c1e..d3a8951a892f875463be5314b8e2fddb4957fa86 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-19  Bill Holmes  <billholmes54@gmail.com>
+
+       * mono-path.c (mono_path_canonicalize): Adding support for UNC
+          paths on Windows.
+
+       Contributed under MIT/X11 license.
+
 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
 
        * mono-mmap.c: Applied patch from Koushik Dutta
index f13c9b04c829e8257e4aece046bb89fc6e35f162..b2310f3cfbc238f1251143ab999c36479842e283 100644 (file)
@@ -67,6 +67,11 @@ mono_path_canonicalize (const char *path)
                lastpos = pos + 1;
                pos = strchr (lastpos, G_DIR_SEPARATOR);
        }
+
+#ifdef PLATFORM_WIN32 /* For UNC paths the first '\' is removed. */
+       if (*(lastpos-1) == G_DIR_SEPARATOR && *(lastpos-2) == G_DIR_SEPARATOR)
+               lastpos = lastpos-1;
+#endif
        
        if (dest != lastpos) strcpy (dest, lastpos);
        return g_strreverse (abspath);