Fix bug # 47336: files with question marks. r=me

This commit is contained in:
rjc%netscape.com 2000-08-22 02:11:11 +00:00
parent ea5d41851a
commit 781a0712bc

View File

@ -1186,7 +1186,8 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, PRBool allowHidden,
leafStr = nsnull;
// we need to escape this leaf name;
// for now, let's just hack it and encode spaces and slashes
// for now, let's just hack it and encode
// spaces, slashes and question marks
PRInt32 aOffset;
while ((aOffset = leaf.FindChar(' ')) >= 0)
{
@ -1198,6 +1199,11 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, PRBool allowHidden,
leaf.Cut((PRUint32)aOffset, 1);
leaf.Insert("%2F", (PRUint32)aOffset);
}
while ((aOffset = leaf.FindChar('?')) >= 0)
{
leaf.Cut((PRUint32)aOffset, 1);
leaf.Insert("%3F", (PRUint32)aOffset);
}
// append the encoded name
fullURI.Append(leaf);