From 79fde062cde98e98e80732486474ffafe68d69db Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 2 Mar 2013 17:06:09 -0800 Subject: [PATCH 1/2] cmPgmOpt.c: Changed _cmPgmOptInsertArg() to add args to the end of the option and mater lists. --- cmPgmOpts.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/cmPgmOpts.c b/cmPgmOpts.c index f717496..6e3ab56 100644 --- a/cmPgmOpts.c +++ b/cmPgmOpts.c @@ -479,11 +479,23 @@ _cmPoArg_t* _cmPgmOptInsertArg( _cmPo_t* p, _cmPoOpt_t* r ) a->opt = r; a->valStr = NULL; - a->link = p->args; // link into master arg list - p->args = a; + // link onto the end of the master arg list + _cmPoArg_t* ap = p->args; + while( ap!=NULL && ap->link != NULL ) + ap=ap->link; + if( ap == NULL ) + p->args = a; + else + ap->link = a; - a->inst = r->inst; // link into opt recd list - r->inst = a; + // link onto the end of the opt recd list + ap = r->inst; + while( ap!=NULL && ap->inst!=NULL) + ap=ap->inst; + if( ap==NULL) + r->inst = a; + else + ap->inst = a; // if no parm. type flag was given then the arg is implicitely a bool and the value is true. //if( (r->flags & kTypeMaskPoFl) == 0 ) From e66934403603dae1ec891172aabbcc8e8b49a484 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 2 Mar 2013 17:09:17 -0800 Subject: [PATCH 2/2] 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. --- cmFileSys.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/cmFileSys.c b/cmFileSys.c index 800812c..0fb29ca 100644 --- a/cmFileSys.c +++ b/cmFileSys.c @@ -896,39 +896,40 @@ cmFsRC_t _cmFileSysDirGetEntries( cmFileSysDeRecd_t* drp, const cmChar_t* dirSt goto errLabel; } - - // is the entry a file - if( _cmFileSysIsFile(drp->p,fn) ) + // is a link + if( _cmFileSysIsLink(drp->p,fn) ) { - if( cmIsFlag(drp->filterFlags,kFileFsFl)==false ) + if( cmIsFlag(drp->filterFlags,kLinkFsFl) == false ) continue; - flags |= kFileFsFl; + flags |= kLinkFsFl; + + if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) ) + if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC ) + goto errLabel; } 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; - flags |= kDirFsFl; - - if( cmIsFlag(drp->filterFlags,kRecurseFsFl) ) - if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC ) - goto errLabel; + flags |= kFileFsFl; } 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; - flags |= kLinkFsFl; + flags |= kDirFsFl; - if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) ) + if( cmIsFlag(drp->filterFlags,kRecurseFsFl) ) if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC ) goto errLabel; }