Part of fixing bug 5781 -- nsImapURI2Path failed to generate local path for folders within another folder

This commit is contained in:
jefft%netscape.com 1999-04-30 21:24:49 +00:00
Родитель 18fb917c67
Коммит faf203f3ca
1 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -121,8 +121,24 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
return rv;
}
if (folder != "")
pathResult += folder;
if (folder != "")
{
nsAutoString parentName = folder;
nsAutoString leafName = folder;
PRInt32 dirEnd = parentName.Find('/');
while(dirEnd > 0)
{
parentName.Right(leafName, parentName.Length() - dirEnd -1);
parentName.Truncate(dirEnd);
parentName += sbdSep;
pathResult += parentName;
parentName = leafName;
dirEnd = parentName.Find('/');
}
if (leafName != "")
pathResult += leafName;
}
return NS_OK;
}