зеркало из https://github.com/mozilla/pjs.git
Make implementations consistent across platforms: ensure IsDirectory and IsFile return false even when the file doesn't exist (and they return an nsresult error status). b=187014 r=dougt sr=alecf
This commit is contained in:
Родитель
4abc025fba
Коммит
4dd14b7edb
|
@ -963,6 +963,7 @@ NS_IMETHODIMP nsLocalFile::IsHidden(PRBool *_retval)
|
|||
NS_IMETHODIMP nsLocalFile::IsDirectory(PRBool *_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
|
||||
FSRef fsRef;
|
||||
nsresult rv = GetFSRefInternal(fsRef);
|
||||
|
@ -982,6 +983,7 @@ NS_IMETHODIMP nsLocalFile::IsDirectory(PRBool *_retval)
|
|||
NS_IMETHODIMP nsLocalFile::IsFile(PRBool *_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
|
||||
FSRef fsRef;
|
||||
nsresult rv = GetFSRefInternal(fsRef);
|
||||
|
|
|
@ -1291,6 +1291,7 @@ NS_IMETHODIMP
|
|||
nsLocalFile::IsDirectory(PRBool *_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
VALIDATE_STAT_CACHE();
|
||||
*_retval = S_ISDIR(mCachedStat.st_mode);
|
||||
return NS_OK;
|
||||
|
@ -1300,6 +1301,7 @@ NS_IMETHODIMP
|
|||
nsLocalFile::IsFile(PRBool *_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
VALIDATE_STAT_CACHE();
|
||||
*_retval = S_ISREG(mCachedStat.st_mode);
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче