2003-10-10 Pedro Mart�nez Juli� <yoros@wanadoo.es>
[mono.git] / mcs / class / System / System.Net / WebClient.cs
index 41383ad3633da46acae3cff84e670d7d83b779db..f1f64d794c09456b604dc8811aa370d7f656a27d 100644 (file)
@@ -291,8 +291,14 @@ namespace System.Net
                        }\r
                        \r
 \r
-                       if (baseAddress == null && query == null)\r
-                               return new Uri (path);\r
+                       if (baseAddress == null && query == null) {\r
+                               try {\r
+                                       return new Uri (path);\r
+                               }\r
+                               catch (System.UriFormatException ufe) {\r
+                                       return new Uri ("file://" + path);\r
+                               }\r
+                       }\r
 \r
                        if (baseAddress == null)\r
                                return new Uri (path + query, (query != null));\r