Author: arina
Date: 2007-12-04 04:05:21 -0500 (Tue, 04 Dec 2007)
New Revision: 90626

Modified:
   trunk/mcs/class/System/ChangeLog
   trunk/mcs/class/System/System/Uri.cs
   trunk/mcs/class/System/Test/ChangeLog
   trunk/mcs/class/System/Test/System/UriTest.cs
   trunk/mcs/class/System/Test/System/UriTest2.cs
Log:
Unix absolute path should not be valid on Windows

Modified: trunk/mcs/class/System/ChangeLog
===================================================================
--- trunk/mcs/class/System/ChangeLog    2007-12-04 08:49:11 UTC (rev 90625)
+++ trunk/mcs/class/System/ChangeLog    2007-12-04 09:05:21 UTC (rev 90626)
@@ -1,5 +1,9 @@
 2007-12-04  Arina Itkes <[EMAIL PROTECTED]>
 
+       * Uri.cs: Unix absolute path should not be valid on Windows.
+
+2007-12-04  Arina Itkes <[EMAIL PROTECTED]>
+
        * HelpKeywordAttribute.cs, WarningException.cs,
          SmtpException.cs, SmtpFailedRecipientException.cs,
          SmtpFailedRecipientsException.cs: 

Modified: trunk/mcs/class/System/System/Uri.cs
===================================================================
--- trunk/mcs/class/System/System/Uri.cs        2007-12-04 08:49:11 UTC (rev 
90625)
+++ trunk/mcs/class/System/System/Uri.cs        2007-12-04 09:05:21 UTC (rev 
90626)
@@ -1284,7 +1284,7 @@
                                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;

Modified: trunk/mcs/class/System/Test/ChangeLog
===================================================================
--- trunk/mcs/class/System/Test/ChangeLog       2007-12-04 08:49:11 UTC (rev 
90625)
+++ trunk/mcs/class/System/Test/ChangeLog       2007-12-04 09:05:21 UTC (rev 
90626)
@@ -1,3 +1,8 @@
+2007-12-04  Arina Itkes <[EMAIL PROTECTED]>
+
+       * UriTest.cs, UriTest2.cs : Tests that check Unix path should 
+         not run on Windows.
+
 2007-07-06  Alan McGovern  <[EMAIL PROTECTED]>
 
        * UriTest.cs : Added test to check that whitespace

Modified: trunk/mcs/class/System/Test/System/UriTest.cs
===================================================================
--- trunk/mcs/class/System/Test/System/UriTest.cs       2007-12-04 08:49:11 UTC 
(rev 90625)
+++ trunk/mcs/class/System/Test/System/UriTest.cs       2007-12-04 09:05:21 UTC 
(rev 90626)
@@ -743,8 +743,10 @@
                [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]

Modified: trunk/mcs/class/System/Test/System/UriTest2.cs
===================================================================
--- trunk/mcs/class/System/Test/System/UriTest2.cs      2007-12-04 08:49:11 UTC 
(rev 90625)
+++ trunk/mcs/class/System/Test/System/UriTest2.cs      2007-12-04 09:05:21 UTC 
(rev 90626)
@@ -70,6 +70,8 @@
 #endif
                public void AbsoluteUriFromFileManual ()
                {
+                       if (Path.DirectorySeparatorChar == '\\')
+                               return;
                        FromResource ("test-uri-props-manual.txt", null);
                }
                

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to