fix for crash when trying to get the parent file when the file was a drive r=dougt bug 50837

This commit is contained in:
pavlov%netscape.com 2000-09-01 07:36:55 +00:00
parent 7aa7ed7f6d
commit 364611d68d

View File

@ -1525,7 +1525,7 @@ nsLocalFile::GetParent(nsIFile * *aParent)
// cannot use nsCString::RFindChar() due to 0x5c problem
PRInt32 offset = (PRInt32) (_mbsrchr((const unsigned char *) parentPath.GetBuffer(), '\\')
- (const unsigned char *) parentPath.GetBuffer());
if (offset == -1)
if (offset < 0)
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
parentPath.Truncate(offset);