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
35
cmFileSys.c
35
cmFileSys.c
@ -896,39 +896,40 @@ cmFsRC_t _cmFileSysDirGetEntries( cmFileSysDeRecd_t* drp, const cmChar_t* dirSt
|
|||||||
goto errLabel;
|
goto errLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// is a link
|
||||||
// is the entry a file
|
if( _cmFileSysIsLink(drp->p,fn) )
|
||||||
if( _cmFileSysIsFile(drp->p,fn) )
|
|
||||||
{
|
{
|
||||||
if( cmIsFlag(drp->filterFlags,kFileFsFl)==false )
|
if( cmIsFlag(drp->filterFlags,kLinkFsFl) == false )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
flags |= kFileFsFl;
|
flags |= kLinkFsFl;
|
||||||
|
|
||||||
|
if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) )
|
||||||
|
if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
|
||||||
|
goto errLabel;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// is the entry a dir
|
|
||||||
if( _cmFileSysIsDir(drp->p,fn) )
|
// is the entry a file
|
||||||
|
if( _cmFileSysIsFile(drp->p,fn) )
|
||||||
{
|
{
|
||||||
if( cmIsFlag(drp->filterFlags,kDirFsFl) == false)
|
if( cmIsFlag(drp->filterFlags,kFileFsFl)==false )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
flags |= kDirFsFl;
|
flags |= kFileFsFl;
|
||||||
|
|
||||||
if( cmIsFlag(drp->filterFlags,kRecurseFsFl) )
|
|
||||||
if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
|
|
||||||
goto errLabel;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( _cmFileSysIsLink(drp->p,fn) )
|
// is the entry a dir
|
||||||
|
if( _cmFileSysIsDir(drp->p,fn) )
|
||||||
{
|
{
|
||||||
if( cmIsFlag(drp->filterFlags,kLinkFsFl) == false )
|
if( cmIsFlag(drp->filterFlags,kDirFsFl) == false)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
flags |= kLinkFsFl;
|
flags |= kDirFsFl;
|
||||||
|
|
||||||
if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) )
|
if( cmIsFlag(drp->filterFlags,kRecurseFsFl) )
|
||||||
if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
|
if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user