cmFileSys.c: Changed _cmFileSysDirEntries() to check for symbolic
links prior to checking for files or dir's because a link may be identified as file or directory.
This commit is contained in:
parent
79fde062cd
commit
e669344036
27
cmFileSys.c
27
cmFileSys.c
@ -896,6 +896,20 @@ cmFsRC_t _cmFileSysDirGetEntries( cmFileSysDeRecd_t* drp, const cmChar_t* dirSt
|
||||
goto errLabel;
|
||||
}
|
||||
|
||||
// is a link
|
||||
if( _cmFileSysIsLink(drp->p,fn) )
|
||||
{
|
||||
if( cmIsFlag(drp->filterFlags,kLinkFsFl) == false )
|
||||
continue;
|
||||
|
||||
flags |= kLinkFsFl;
|
||||
|
||||
if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) )
|
||||
if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
|
||||
goto errLabel;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// is the entry a file
|
||||
if( _cmFileSysIsFile(drp->p,fn) )
|
||||
@ -920,19 +934,6 @@ cmFsRC_t _cmFileSysDirGetEntries( cmFileSysDeRecd_t* drp, const cmChar_t* dirSt
|
||||
goto errLabel;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( _cmFileSysIsLink(drp->p,fn) )
|
||||
{
|
||||
if( cmIsFlag(drp->filterFlags,kLinkFsFl) == false )
|
||||
continue;
|
||||
|
||||
flags |= kLinkFsFl;
|
||||
|
||||
if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) )
|
||||
if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
|
||||
goto errLabel;
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user