зеркало из https://github.com/mozilla/pjs.git
When enumerating a folder's contents, don't resolve aliases, and don't return hidden files/folders.
This commit is contained in:
Родитель
b10f20d8ff
Коммит
0e42aabae7
|
@ -47,7 +47,7 @@ nsDirectoryIndexStream::Init(const nsFileSpec& aDir)
|
|||
|
||||
// Sigh. We have to allocate on the heap because there are no
|
||||
// assignment operators defined.
|
||||
mIter = new nsDirectoryIterator(mDir, PR_TRUE);
|
||||
mIter = new nsDirectoryIterator(mDir, PR_FALSE); // rjc: don't resolve aliases
|
||||
if (! mIter)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
|
@ -153,6 +153,9 @@ nsDirectoryIndexStream::Read(char* aBuf, PRUint32 aCount, PRUint32* aReadCount)
|
|||
nsFileSpec current = mIter->Spec();
|
||||
++(*mIter);
|
||||
|
||||
// rjc: don't return hidden files/directories!
|
||||
if (current.IsHidden()) continue;
|
||||
|
||||
PRFileInfo fileinfo;
|
||||
PRStatus status = PR_GetFileInfo(nsNSPRPath(current), &fileinfo);
|
||||
if (status != PR_SUCCESS)
|
||||
|
|
Загрузка…
Ссылка в новой задаче