#141877 file:// protocol does not display non ASCII folder name under cjk window system

use mbsrchr to check if the last char in patch is '\'
r=dougt, sr=alecf
This commit is contained in:
shanjian%netscape.com 2002-05-07 20:09:07 +00:00
parent 847b3ad569
commit d2a268fe04

View File

@ -725,7 +725,8 @@ nsLocalFile::InitWithNativePath(const nsACString &filePath)
// kill any trailing '\' provided it isn't the second char of DBCS
PRInt32 len = pathLen - 1;
if (path[len] == '\\' && !::IsDBCSLeadByte(path[len-1]))
if (path[len] == '\\' && (!::IsDBCSLeadByte(path[len-1]) ||
_mbsrchr((const unsigned char *)path, '\\') == (const unsigned char *)path+len))
{
path[len] = '\0';
pathLen = len;