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

git-svn-id: svn://10.0.0.236/trunk@132129 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neeti%netscape.com
2002-10-17 03:23:33 +00:00
parent a4602c0168
commit a2b623c752
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;