From 2c189eebdfca747d5140553b2b364b449dbc7ccf Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Fri, 17 Sep 1999 07:03:09 +0000 Subject: [PATCH] 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. git-svn-id: svn://10.0.0.236/trunk@47943 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsFileSpecMac.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mozilla/xpcom/io/nsFileSpecMac.cpp b/mozilla/xpcom/io/nsFileSpecMac.cpp index 12e57013625..77f3be47d59 100644 --- a/mozilla/xpcom/io/nsFileSpecMac.cpp +++ b/mozilla/xpcom/io/nsFileSpecMac.cpp @@ -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)