[BACK]Return to parse.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/parse.c between version 1.37 and 1.38

version 1.37, 2000/03/26 16:21:32 version 1.38, 2000/04/17 23:45:24
Line 104 
Line 104 
 #include "buf.h"  #include "buf.h"
 #include "pathnames.h"  #include "pathnames.h"
   
   #ifdef CLEANUP
   static Lst          fileNames;  /* file names to free at end */
   #endif
   
 /*  /*
  * These values are returned by ParseEOF to tell Parse_File whether to   * These values are returned by ParseEOF to tell Parse_File whether to
  * CONTINUE parsing, i.e. it had only reached the end of an include file,   * CONTINUE parsing, i.e. it had only reached the end of an include file,
Line 1808 
Line 1812 
      * place. Naturally enough, we start reading at line number 0.       * place. Naturally enough, we start reading at line number 0.
      */       */
     fname = fullname;      fname = fullname;
   #ifdef CLEANUP
       Lst_AtEnd(fileNames, fname);
   #endif
     lineno = 0;      lineno = 0;
   
     curFILE = fopen (fullname, "r");      curFILE = fopen (fullname, "r");
Line 1857 
Line 1864 
     curPTR = (PTR *) emalloc (sizeof (PTR));      curPTR = (PTR *) emalloc (sizeof (PTR));
     curPTR->str = curPTR->ptr = str;      curPTR->str = curPTR->ptr = str;
     lineno = newlineno;      lineno = newlineno;
     fname = estrdup(fname);  
 }  }
   
   
Line 1991 
Line 1997 
      * place. Naturally enough, we start reading at line number 0.       * place. Naturally enough, we start reading at line number 0.
      */       */
     fname = fullname;      fname = fullname;
   #ifdef CLEANUP
       lst_AtEnd(fileNames, fname);
   #endif
     lineno = 0;      lineno = 0;
   
     curFILE = fopen (fullname, "r");      curFILE = fopen (fullname, "r");
Line 2028 
Line 2037 
   
     if ((ifile = (IFile *)Lst_DeQueue(includes)) == NULL)      if ((ifile = (IFile *)Lst_DeQueue(includes)) == NULL)
         return DONE;          return DONE;
     free ((Address) fname);  
     fname = ifile->fname;      fname = ifile->fname;
     lineno = ifile->lineno;      lineno = ifile->lineno;
     if (opened && curFILE)      if (opened && curFILE)
Line 2455 
Line 2463 
                   *line;        /* the line we're working on */                    *line;        /* the line we're working on */
   
     inLine = FALSE;      inLine = FALSE;
     fname = name;      fname = estrdup(name);
   #ifdef CLEANUP
       Lst_AtEnd(fileNames, fname);
   #endif
     curFILE = stream;      curFILE = stream;
     lineno = 0;      lineno = 0;
     fatals = 0;      fatals = 0;
Line 2641 
Line 2652 
     includes = Lst_Init();      includes = Lst_Init();
 #ifdef CLEANUP  #ifdef CLEANUP
     targCmds = Lst_Init();      targCmds = Lst_Init();
       fileNames = Lst_Init();
 #endif  #endif
 }  }
   
Line 2649 
Line 2661 
 {  {
 #ifdef CLEANUP  #ifdef CLEANUP
     Lst_Destroy(targCmds, (void (*) __P((ClientData))) free);      Lst_Destroy(targCmds, (void (*) __P((ClientData))) free);
       Lst_Destroy(fileNames, (void (*) __P((ClientData))) free);
     if (targets)      if (targets)
         Lst_Destroy(targets, NOFREE);          Lst_Destroy(targets, NOFREE);
     Lst_Destroy(sysIncPath, Dir_Destroy);      Lst_Destroy(sysIncPath, Dir_Destroy);
Line 2695 
Line 2708 
 Parse_Getlineno()  Parse_Getlineno()
 {  {
     return lineno;      return lineno;
   }
   
   const char *
   Parse_Getfilename()
   {
       return fname;
 }  }
   

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38