Browse Source

Merge branch 'master' of klarke.webfactional.com:webapps/git/repos/libcm

master
kevin 11 years ago
parent
commit
865ac36953
2 changed files with 34 additions and 21 deletions
  1. 18
    17
      cmFileSys.c
  2. 16
    4
      cmPgmOpts.c

+ 18
- 17
cmFileSys.c View File

@@ -896,39 +896,40 @@ cmFsRC_t _cmFileSysDirGetEntries(  cmFileSysDeRecd_t* drp, const cmChar_t* dirSt
896 896
         goto errLabel;
897 897
       }
898 898
 
899
-
900
-      // is the entry a file
901
-      if( _cmFileSysIsFile(drp->p,fn) )
899
+      // is a link
900
+      if( _cmFileSysIsLink(drp->p,fn) )
902 901
       {
903
-        if( cmIsFlag(drp->filterFlags,kFileFsFl)==false )
902
+        if( cmIsFlag(drp->filterFlags,kLinkFsFl) == false )
904 903
           continue;
905 904
 
906
-        flags |= kFileFsFl;
905
+        flags |= kLinkFsFl;
906
+
907
+        if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) )
908
+          if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
909
+            goto errLabel;
907 910
       }
908 911
       else
909 912
       {
910
-        // is the entry a dir
911
-        if( _cmFileSysIsDir(drp->p,fn) )
913
+
914
+        // is the entry a file
915
+        if( _cmFileSysIsFile(drp->p,fn) )
912 916
         {
913
-          if( cmIsFlag(drp->filterFlags,kDirFsFl) == false)
917
+          if( cmIsFlag(drp->filterFlags,kFileFsFl)==false )
914 918
             continue;
915 919
 
916
-          flags |= kDirFsFl;
917
-
918
-          if( cmIsFlag(drp->filterFlags,kRecurseFsFl) )
919
-            if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
920
-              goto errLabel;
920
+          flags |= kFileFsFl;
921 921
         }
922 922
         else
923 923
         {
924
-          if( _cmFileSysIsLink(drp->p,fn) )
924
+          // is the entry a dir
925
+          if( _cmFileSysIsDir(drp->p,fn) )
925 926
           {
926
-            if( cmIsFlag(drp->filterFlags,kLinkFsFl) == false )
927
+            if( cmIsFlag(drp->filterFlags,kDirFsFl) == false)
927 928
               continue;
928 929
 
929
-            flags |= kLinkFsFl;
930
+            flags |= kDirFsFl;
930 931
 
931
-            if( cmIsFlag(drp->filterFlags,kRecurseLinksFsFl) )
932
+            if( cmIsFlag(drp->filterFlags,kRecurseFsFl) )
932 933
               if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
933 934
                 goto errLabel;
934 935
           }

+ 16
- 4
cmPgmOpts.c View File

@@ -479,11 +479,23 @@ _cmPoArg_t* _cmPgmOptInsertArg( _cmPo_t* p,  _cmPoOpt_t* r )
479 479
   a->opt        = r;
480 480
   a->valStr     = NULL;
481 481
 
482
-  a->link       = p->args;  // link into master arg list
483
-  p->args       = a;
482
+  // link onto the end of the  master arg list
483
+  _cmPoArg_t* ap = p->args;
484
+  while( ap!=NULL && ap->link != NULL )
485
+    ap=ap->link;
486
+  if( ap == NULL )
487
+    p->args = a;
488
+  else
489
+    ap->link = a;
484 490
   
485
-  a->inst       = r->inst;  // link into opt recd list
486
-  r->inst       = a;
491
+   // link onto the end of the opt recd list
492
+  ap = r->inst;
493
+  while( ap!=NULL && ap->inst!=NULL)
494
+    ap=ap->inst;
495
+  if( ap==NULL)
496
+    r->inst = a;
497
+  else
498
+    ap->inst = a;
487 499
 
488 500
   // if no parm. type flag was given then the arg is implicitely a bool and the value is true.
489 501
   //if( (r->flags & kTypeMaskPoFl) == 0 )

Loading…
Cancel
Save