diff options
Diffstat (limited to 'mcs/class/System.Web/System.Web.Util/UrlUtils.cs')
-rw-r--r-- | mcs/class/System.Web/System.Web.Util/UrlUtils.cs | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs index 179158ec1ab..6e158a40c0b 100644 --- a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs +++ b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs @@ -177,41 +177,17 @@ namespace System.Web.Util { { url = url.Replace('\\','/'); int last = url.LastIndexOf ('/'); - - if (last > 0) { -#if NET_2_0 - return RemoveDoubleSlashes (url.Substring (0, last)); -#else + if (last > 0) return url.Substring (0, last); -#endif - } - return "/"; } -#if NET_2_0 - internal static string RemoveDoubleSlashes (string input) - { - // MS VirtualPathUtility removes duplicate '/' - string str = input; - string x; - while ((x = str.Replace ("//", "/")) != str) { - str = x; - } - - return str; - } -#endif - internal static string GetFile (string url) { url = url.Replace('\\','/'); int last = url.LastIndexOf ('/'); - if (last >= 0) { - if (url.Length == 1) // Empty file name instead of ArgumentOutOfRange - return ""; + if (last >= 0) return url.Substring (last+1); - } throw new Exception (String.Format ("GetFile: `{0}' does not contain a /", url)); } |