2009-01-13 Stephane Delcroix <sdelcroix@novell.com>
authorStephane Delcroix <stephane@mono-cvs.ximian.com>
Tue, 13 Jan 2009 10:12:54 +0000 (10:12 -0000)
committerStephane Delcroix <stephane@mono-cvs.ximian.com>
Tue, 13 Jan 2009 10:12:54 +0000 (10:12 -0000)
* Uri.cs: Fix the previous patch for 1.0 profile

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

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

index 47a9d71fff34319087410ffd8ead3f02a74ec3e5..6d7f6389ee688862e5b670bc1c3b22d1bc944350 100644 (file)
@@ -1,3 +1,7 @@
+2009-01-13  Stephane Delcroix  <sdelcroix@novell.com>
+
+       * Uri.cs: Fix the previous patch for 1.0 profile
+
 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * Uri.cs: avoid throwing exceptions when checking for the host name
index a87c3f239ade7a78c6d6078962ee78ee8564b64a..2ad7a2b8485754ec672de7ff3a47cfd802aca27e 100644 (file)
@@ -723,8 +723,16 @@ namespace System {
                                if (length == 0)
                                        return false;
                                uint number;
+#if NET_2_0
                                if (!UInt32.TryParse (captures [i], out number))
                                        return false;
+#else
+                               try {
+                                       number = UInt32.Parse (captures [i]);
+                               } catch (Exception) {
+                                       return false;
+                               }
+#endif
                                if (number > 255)
                                        return false;
                        }