Unix absolute path should not be valid on Windows
authorArina Itkes <arina@mono-cvs.ximian.com>
Tue, 4 Dec 2007 09:05:21 +0000 (09:05 -0000)
committerArina Itkes <arina@mono-cvs.ximian.com>
Tue, 4 Dec 2007 09:05:21 +0000 (09:05 -0000)
svn path=/trunk/mcs/; revision=90626

mcs/class/System/ChangeLog
mcs/class/System/System/Uri.cs
mcs/class/System/Test/ChangeLog
mcs/class/System/Test/System/UriTest.cs
mcs/class/System/Test/System/UriTest2.cs

index 188c9ca963bd965fb97520822d4a8e16f2fb2a08..7dc5dbf2c085e40aa0dd2d96cf0598396c2a3cd2 100644 (file)
@@ -1,3 +1,7 @@
+2007-12-04  Arina Itkes <arinai@mainsoft.com>
+
+       * Uri.cs: Unix absolute path should not be valid on Windows.
+
 2007-12-04  Arina Itkes <arinai@mainsoft.com>
 
        * HelpKeywordAttribute.cs, WarningException.cs,
index f5747140e44adf470ec9856f3eeef7adf2645ff5..8c3bb4f699bc4712879481aea3f99d6f78d3e308 100644 (file)
@@ -1284,7 +1284,7 @@ namespace System {
                                throw new UriFormatException("Invalid URI: The format of the URI could not be determined.");
                        } else if (pos < 0) {
                                // It must be Unix file path or Windows UNC
-                               if (uriString [0] == '/'){
+                               if (uriString [0] == '/' && Path.DirectorySeparatorChar == '/'){
                                        ParseAsUnixAbsoluteFilePath (uriString);
                                        if (kind == UriKind.Relative)
                                                isAbsoluteUri = false;
index eb4e4c848d22b22e8e0393e8ff85fd6d1337f443..4be24293b74c1ee7ebfabc2cf8711e30c0164cc4 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-04  Arina Itkes <arinai@mainsoft.com>
+
+       * UriTest.cs, UriTest2.cs : Tests that check Unix path should 
+         not run on Windows.
+
 2007-07-06  Alan McGovern  <amcgovern@novell.com>
 
        * UriTest.cs : Added test to check that whitespace
index 4b5046f5029aac5a4b8fc1b37fa6395ac7105049..13fb3f2c03b288999494a4f38d54047b3d9dd413 100644 (file)
@@ -743,8 +743,10 @@ namespace MonoTests.System
                [Category("NotDotNet")]
                public void UncFail ()
                {
-                       Uri uri = new Uri ("/home/user/dir/filename.ext");
-                       Assert ("#7", !uri.IsUnc);
+                       if (!isWin32) {
+                               Uri uri = new Uri ("/home/user/dir/filename.ext");
+                               Assert ("#7", !uri.IsUnc);
+                       }
                }
 
                [Test]
index c6956a811bffb578a6605a48f385167595a7b929..51d527857a5ee735bfb9ca11ac7112e697eda46e 100644 (file)
@@ -70,6 +70,8 @@ namespace MonoTests.System
 #endif\r
                public void AbsoluteUriFromFileManual ()\r
                {\r
+                       if (Path.DirectorySeparatorChar == '\\')\r
+                               return;\r
                        FromResource ("test-uri-props-manual.txt", null);\r
                }\r
                \r