-
Notifications
You must be signed in to change notification settings - Fork 999
Closed
Description
There is a bug in DropPathRoot (in WindowsPathUtils.cs / ICSharpCode.SharpZipLib.Core.WindowsPathUtils) that causes an IndexOutOfBoundsException:
This can be seen for paths such as "\server". It works correctly (as it is) for paths such as "\server\share".
is:
// Scan for two separate elements \\machine\share\restofpath
while ((index <= path.Length) &&
(((path[index] != '\\') && (path[index] != '/')) || (--elements > 0))) {
index++;
}should likely be (but I think other modifications will be needed as well to obtain desired behavior):
// Scan for two separate elements \\machine\share\restofpath
while ((index < path.Length) &&
(((path[index] != '\\') && (path[index] != '/')) || (--elements > 0))) {
index++;
}Also, since "index" starts at 2, a few lines above, I'm not sure what the purpose of "elements" is -- possibly a left over?
Thoughts?