fix for bug 161352 - URL: can't load local file with semicolon (;) in name,r=dougt@netscape.com,sr=darin@netscape.com,a=asa@mozilla.org

This commit is contained in:
neeti%netscape.com 2002-10-17 03:23:33 +00:00
parent f3eb2b7dd8
commit 5771630720
4 changed files with 16 additions and 0 deletions

View File

@ -89,6 +89,10 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &aURL)
// need encoding; use %2F which is a forward slash
escPath.ReplaceSubstring(":", "%2F");
// esc_Directory does not escape the semicolons, so if a filename
// contains semicolons we need to manually escape them.
escPath.ReplaceSubstring(";", "%3b");
escPath.Insert(prefix, 0);
// XXX this should be unnecessary

View File

@ -78,6 +78,10 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
else
escPath.Assign(prefix + ePath);
// esc_Directory does not escape the semicolons, so if a filename
// contains semicolons we need to manually escape them.
escPath.ReplaceSubstring(";", "%3b");
// XXX this should be unnecessary
if (escPath[escPath.Length() - 1] != '/') {
PRBool dir;

View File

@ -61,6 +61,10 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
else
escPath.Assign(prefix + ePath);
// esc_Directory does not escape the semicolons, so if a filename
// contains semicolons we need to manually escape them.
escPath.ReplaceSubstring(";", "%3b");
// XXX this should be unnecessary
if (escPath[escPath.Length() - 1] != '/') {
PRBool dir;

View File

@ -74,6 +74,10 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
else
escPath.Assign(prefix + ePath);
// esc_Directory does not escape the semicolons, so if a filename
// contains semicolons we need to manually escape them.
escPath.ReplaceSubstring(";", "%3b");
// XXX this should be unnecessary
if (escPath[escPath.Length() - 1] != '/') {
PRBool dir;