Bladeren bron

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

master
kevin 11 jaren geleden
bovenliggende
commit
865ac36953
2 gewijzigde bestanden met toevoegingen van 34 en 21 verwijderingen
  1. 18
    17
      cmFileSys.c
  2. 16
    4
      cmPgmOpts.c

+ 18
- 17
cmFileSys.c Bestand weergeven

896
         goto errLabel;
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
           continue;
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
       else
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
             continue;
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
         else
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
               continue;
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
               if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
933
               if((rc = _cmFileSysDirGetEntries(drp,fn)) != kOkFsRC )
933
                 goto errLabel;
934
                 goto errLabel;
934
           }
935
           }

+ 16
- 4
cmPgmOpts.c Bestand weergeven

479
   a->opt        = r;
479
   a->opt        = r;
480
   a->valStr     = NULL;
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
   // if no parm. type flag was given then the arg is implicitely a bool and the value is true.
500
   // if no parm. type flag was given then the arg is implicitely a bool and the value is true.
489
   //if( (r->flags & kTypeMaskPoFl) == 0 )
501
   //if( (r->flags & kTypeMaskPoFl) == 0 )

Laden…
Annuleren
Opslaan