mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Really skip hidden files when requested in a directory enumeration
This commit is contained in:
parent
d5d8a71c79
commit
47d2446df4
2 changed files with 11 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
|||
2022-11-21 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSFileManager.m:
|
||||
Call NSDirectoryEnumerator's constructor with either YES or NO for
|
||||
the BOOL arguments.
|
||||
Really skip hidden files in enumerations if requested by the
|
||||
options.
|
||||
|
||||
2022-11-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSFileHandle.h:
|
||||
|
|
|
@ -909,10 +909,10 @@ static NSStringEncoding defaultEncoding;
|
|||
|
||||
direnum = [[NSDirectoryEnumerator alloc]
|
||||
initWithDirectoryPath: path
|
||||
recurseIntoSubdirectories: !(mask & NSDirectoryEnumerationSkipsSubdirectoryDescendants)
|
||||
recurseIntoSubdirectories: !(mask & NSDirectoryEnumerationSkipsSubdirectoryDescendants) ? YES : NO
|
||||
followSymlinks: NO
|
||||
justContents: NO
|
||||
skipHidden: (mask & NSDirectoryEnumerationSkipsHiddenFiles)
|
||||
skipHidden: (mask & NSDirectoryEnumerationSkipsHiddenFiles) ? YES : NO
|
||||
errorHandler: handler
|
||||
for: self];
|
||||
|
||||
|
@ -2803,7 +2803,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
if (dirname)
|
||||
{
|
||||
// Skip it if it is hidden and flag is yes...
|
||||
if ([[dir.path lastPathComponent] hasPrefix: @"."]
|
||||
if (dirname[0] == '.'
|
||||
&& _flags.skipHidden == YES)
|
||||
{
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue