Bug #262018 --> Unable to create local folders that contain semicolons or # characters. Messages in these local

folders never load.

Make our folder hash routine smart enough to hash folder names that contain these characters.

sr=bienvenu

Porting Thunderbird 1.0 bug to the trunk
This commit is contained in:
scott%scott-macgregor.org 2004-11-19 01:13:52 +00:00
parent 3ed5153e77
commit 9beb72aa15

View File

@ -72,6 +72,8 @@ static NS_DEFINE_CID(kImapUrlCID, NS_IMAPURL_CID);
static NS_DEFINE_CID(kCMailboxUrl, NS_MAILBOXURL_CID);
static NS_DEFINE_CID(kCNntpUrlCID, NS_NNTPURL_CID);
#define ILLEGAL_FOLDER_CHARS ";#"
#define NS_PASSWORDMANAGER_CATEGORY "passwordmanager"
static PRBool gInitPasswordManager = PR_FALSE;
@ -263,7 +265,7 @@ inline PRUint32 StringHash(const nsAutoString& str)
nsresult NS_MsgHashIfNecessary(nsCAutoString &name)
{
NS_NAMED_LITERAL_CSTRING (illegalChars,
FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS);
FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS ILLEGAL_FOLDER_CHARS);
nsCAutoString str(name);
// Given a filename, make it safe for filesystem
@ -307,7 +309,7 @@ nsresult NS_MsgHashIfNecessary(nsCAutoString &name)
nsresult NS_MsgHashIfNecessary(nsAutoString &name)
{
PRInt32 illegalCharacterIndex = name.FindCharInSet(
FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS);
FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS ILLEGAL_FOLDER_CHARS);
char hashedname[9];
if (illegalCharacterIndex == kNotFound)