Make nsFileSpecMac tough enough to deal with a Unix-style path with two or more forward slashes that are right next to each other; e.g., foo//bar/baz.html. Previously, it would convert this to foo::bar:baz.html, which is the Unix equivalent of foo/../bar/baz.html. Oops. Anyway, this keeps Mac from crashing on startup.

This commit is contained in:
waterson%netscape.com 1999-09-17 07:03:09 +00:00
parent 3509f48fd2
commit fa6c2fad91

View File

@ -269,6 +269,14 @@ char* MacFileHelpers::MacPathFromUnixPath(const char* unixPath, Boolean hexDecod
}
continue;
}
else if (c == '/' && cprev == '/')
{
// Hmm. A 'run on' path with two slashes right next to each other.
// This is an illegal path, but, hey, we'll be tough and try to
// deal with it (especially since '::' has loaded semantics in
// a Mac path)
continue;
}
*dst++ = c;
} while (c);
if (hexDecode)