Removed Consoles and ^Ms
[mono.git] / mcs / class / System / System.Net / WebClient.cs
index f1f64d794c09456b604dc8811aa370d7f656a27d..ca424855e3ffefb5c669487e150c12b6e65d8bd1 100644 (file)
@@ -295,8 +295,13 @@ namespace System.Net
                                try {\r
                                        return new Uri (path);\r
                                }\r
-                               catch (System.UriFormatException ufe) {\r
-                                       return new Uri ("file://" + path);\r
+                               catch (System.UriFormatException) {\r
+                                       if ((path[0] == Path.DirectorySeparatorChar) || (path[1] == ':' && Char.ToLower(path[0]) > 'a' && Char.ToLower(path[0]) < 'z')) {\r
+                                               return new Uri ("file://" + path);\r
+                                       }\r
+                                       else {\r
+                                               return new Uri ("file://" + Environment.CurrentDirectory + Path.DirectorySeparatorChar + path);\r
+                                       }\r
                                }\r
                        }\r
 \r