b=53596, r=dougt, sr=brendan

nsLocalFileUnix fix for ::GetLeafName not working on relative paths

--pete


git-svn-id: svn://10.0.0.236/trunk@107859 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pete%alphanumerica.com
2001-11-11 00:15:28 +00:00
parent 52581f47aa
commit 6ca4d43048

View File

@@ -478,11 +478,8 @@ nsresult
nsLocalFile::GetLeafNameRaw(const char **_retval)
{
CHECK_mPath();
const char *leafName = strrchr((const char *)mPath, '/');
NS_ASSERTION(leafName, "non-canonical mPath?");
if (!leafName)
return NS_ERROR_FILE_INVALID_PATH;
*_retval = leafName+1;
const char *leafName = strrchr(mPath.get(), '/');
*_retval = leafName ? leafName + 1 : mPath.get();
return NS_OK;
}