* Path.cs: fixed a couple of bugs reported in #35906.
svn path=/trunk/mcs/; revision=12104
+2003-03-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Path.cs: fixed a couple of bugs reported in #35906.
+
2003-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Directory.cs: fixed bugs #38939 and #38940. No need for separate
if (path.Length > 0)
{
int nLast = path.LastIndexOfAny (PathSeparatorChars);
+ if (nLast == 0)
+ nLast++;
if (nLast > 0)
return path.Substring (0, nLast);
throw new ArgumentException ("Illegal characters in path", "path");
int nLast = path.LastIndexOfAny (PathSeparatorChars);
- if (nLast > 0)
+ if (nLast >= 0)
return path.Substring (nLast + 1);
- return nLast == 0 ? null : path;
+ return path;
}
public static string GetFileNameWithoutExtension (string path)