From e27ee398e4bc4e263ac5e0757b7b1a0b46664d0a Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 12 Feb 2002 21:05:56 +0000 Subject: [PATCH] Get rid of extra leading slashes appearing in unix paths. Bug 124873, r=petejc@optonline.net, sr=brendan. git-svn-id: svn://10.0.0.236/trunk@114303 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileUnix.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index 93336ac5617..93bb22eee73 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -436,7 +436,11 @@ nsLocalFile::AppendRelativePath(const char *fragment) if (*fragment == '/') return NS_ERROR_FILE_UNRECOGNIZED_PATH; - mPath.Append(NS_LITERAL_CSTRING("/") + nsDependentCString(fragment)); + if (mPath.Equals("/")) { + mPath.Append(nsDependentCString(fragment)); + } else { + mPath.Append(NS_LITERAL_CSTRING("/") + nsDependentCString(fragment)); + } if (!mPath.get()) return NS_ERROR_OUT_OF_MEMORY;