Fix for bug 177964 - FTP: can't download file with # in its name,r=nhotta@netscape.com,sr=darin@netscape.com,a=asa@mozilla.org

This commit is contained in:
neeti%netscape.com 2002-12-05 19:18:57 +00:00
parent f5f30c3255
commit e4a47a5802

View File

@ -490,9 +490,17 @@ nsIndexedToHTML::OnIndexAvailable(nsIRequest *aRequest,
rv = mTextToSubURI->UnEscapeAndConvert(encoding, loc,
getter_Copies(unEscapeSpec));
if (NS_FAILED(rv)) return rv;
pushBuffer.Append(unEscapeSpec);
// need to escape links
nsCAutoString escapeBuf;
NS_ConvertUCS2toUTF8 utf8UnEscapeSpec(unEscapeSpec);
NS_EscapeURL(utf8UnEscapeSpec.get(), utf8UnEscapeSpec.Length(),
esc_FileBaseName|esc_OnlyASCII|esc_AlwaysCopy, escapeBuf);
pushBuffer.Append(NS_ConvertUTF8toUCS2(escapeBuf));
pushBuffer.Append(NS_LITERAL_STRING("\"><img src=\""));
switch (type) {