diff --git a/netwerk/base/src/nsAuthURLParser.cpp b/netwerk/base/src/nsAuthURLParser.cpp index 0f7bb39d6294..92a5e008a825 100644 --- a/netwerk/base/src/nsAuthURLParser.cpp +++ b/netwerk/base/src/nsAuthURLParser.cpp @@ -406,6 +406,13 @@ nsAuthURLParser::ParseAtDirectory(const char* i_Path, char* *o_Directory, if (file != dirfile) { ExtractString(dirfile, o_Directory, (file - dirfile)+1); + if (*dirfile != '/') { + nsCAutoString dir; + dir += "/" ; + dir += *o_Directory; + CRTFREEIF(*o_Directory); + *o_Directory = dir.ToNewCString(); + } } else { DupString(o_Directory, "/"); } diff --git a/netwerk/base/src/nsNoAuthURLParser.cpp b/netwerk/base/src/nsNoAuthURLParser.cpp index d4716b240e49..22d343450e22 100644 --- a/netwerk/base/src/nsNoAuthURLParser.cpp +++ b/netwerk/base/src/nsNoAuthURLParser.cpp @@ -248,6 +248,13 @@ nsNoAuthURLParser::ParseAtDirectory(const char* i_Path, char* *o_Directory, if (file != dirfile) { ExtractString(dirfile, o_Directory, (file - dirfile)+1); + if (*dirfile != '/') { + nsCAutoString dir; + dir += "/" ; + dir += *o_Directory; + CRTFREEIF(*o_Directory); + *o_Directory = dir.ToNewCString(); + } } else { DupString(o_Directory, "/"); }