2009-10-15 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 15 Oct 2009 06:21:48 +0000 (06:21 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 15 Oct 2009 06:21:48 +0000 (06:21 -0000)
* Uri.cs : do not reject relative short name URI when uriKind is
  RelativeOrAbsolute.

* UriTest3.cs : added test for parsing short name with
  RelativeOrAbsolute mode.

svn path=/trunk/mcs/; revision=144175

mcs/class/System/System/ChangeLog
mcs/class/System/System/Uri.cs
mcs/class/System/Test/System/ChangeLog
mcs/class/System/Test/System/UriTest3.cs

index 7ed5a62362bbf4e9b8058507d9ca9e6f8f0fa34f..10adfa971c73847972163036c4bde502ad308136 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-15  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * Uri.cs : do not reject relative short name URI when uriKind is
+         RelativeOrAbsolute.
+
 2009-09-01  Raja R Harinath  <harinath@hurrynot.org>
 
        Fix #533572
index d95994a050dbb1163931ed99100c79b6f19d2b3f..95101042978764392c10b2fb3700f1568ee2b8a1 100644 (file)
@@ -1367,7 +1367,7 @@ namespace System {
                                }
                        }
                        
-                       if (len <= 1 && (kind != UriKind.Relative))
+                       if (len <= 1 && (kind == UriKind.Absolute))
                                return "Absolute URI is too short";
 
                        int pos = 0;
index a2aa1e62e0c7bc75022267b693c18e8ac9918a8e..f5b662dc9f697106d5e9f6caf518297cd45eaef6 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-15  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * UriTest3.cs : added test for parsing short name with
+         RelativeOrAbsolute mode.
+
 2009-09-01  Andres Aragoneses  <aaragoneses@novell.com>
 
        * UriTest.cs: New tests from #533572.
index 0d5f9ff05600529207a05a9225de396755d2d3a1..6bfb9012f9518f3c4a493331165caa50be27646e 100644 (file)
@@ -601,6 +601,12 @@ namespace MonoTests.System
                        }
                }
 
+               [Test]
+               public void ParseShortNameAsRelativeOrAbsolute ()
+               {
+                       new Uri ("x", UriKind.RelativeOrAbsolute);
+               }
+
                private class TolerantUriParser : GenericUriParser
                {
                        private const GenericUriParserOptions DefaultOptions