/[ascend]/trunk/base/generic/general/ospath.c
ViewVC logotype

Diff of /trunk/base/generic/general/ospath.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 542 by johnpye, Wed Apr 26 15:15:40 2006 UTC revision 543 by johnpye, Thu Apr 27 00:04:13 2006 UTC
# Line 13  Line 13 
13  # endif  # endif
14  #endif  #endif
15    
16  //#define VERBOSE  #define VERBOSE
17    
18  #if !defined(TEST) && !defined(VERBOSE)  #if !defined(TEST) && !defined(VERBOSE)
19  # define NDEBUG  # define NDEBUG
# Line 649  char *ospath_getbasefilename(struct File Line 649  char *ospath_getbasefilename(struct File
649      if(pos != NULL){      if(pos != NULL){
650          unsigned length1 = length - ((pos - fp->path) + 1);          unsigned length1 = length - ((pos - fp->path) + 1);
651          temp = CALLOC(length1,sizeof(char));          temp = CALLOC(length1,sizeof(char));
652            
653          V(length1);          V(length1);
654          STRNCPY(temp, pos + 1, length1);          STRNCPY(temp, pos + 1, length1);
655          return temp;          return temp;
# Line 1111  struct FilePath *ospath_searchpath_itera Line 1111  struct FilePath *ospath_searchpath_itera
1111      for(p=searchpath; *p!=NULL; ++p){      for(p=searchpath; *p!=NULL; ++p){
1112          D(*p);          D(*p);
1113      }      }
1114        
1115      for(p=searchpath; *p!=NULL; ++p){      for(p=searchpath; *p!=NULL; ++p){
1116          D(*p);          D(*p);
1117          if((*testfn)(*p,searchdata)){          if((*testfn)(*p,searchdata)){
# Line 1356  int main(void){ Line 1356  int main(void){
1356      assert(ospath_cmp(fp3,pp[1])==0);      assert(ospath_cmp(fp3,pp[1])==0);
1357      M("Passed path-search test\n");      M("Passed path-search test\n");
1358    
1359      ospath_free(fp1);        ospath_free(fp1);
1360      ospath_free(fp2);      ospath_free(fp2);
1361      ospath_searchpath_free(pp);      ospath_searchpath_free(pp);
1362    
# Line 1380  int main(void){ Line 1380  int main(void){
1380      ospath_free(fp2);      ospath_free(fp2);
1381      ospath_free(fp3);      ospath_free(fp3);
1382      ospath_searchpath_free(pp);      ospath_searchpath_free(pp);
1383        
1384      //-------------------------------      //-------------------------------
1385    
1386      fp1 = ospath_new("/usr/share/data/ascend/models/johnpye/extfn/extfntest.a4c");      fp1 = ospath_new("/usr/share/data/ascend/models/johnpye/extfn/extfntest.a4c");
# Line 1576  int main(void){ Line 1576  int main(void){
1576      ospath_free(fp2);      ospath_free(fp2);
1577      ospath_free(fp3);      ospath_free(fp3);
1578    
1579      //---------------------------------      //---------------------------------
1580      M("ALL TESTS PASSED");      M("ALL TESTS PASSED");
1581  }  }
1582    

Legend:
Removed from v.542  
changed lines
  Added in v.543

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22