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

Diff for /src/usr.bin/make/lowparse.c between version 1.28 and 1.29

version 1.28, 2012/08/25 08:12:56 version 1.29, 2012/09/21 07:55:20
Line 116 
Line 116 
  *      (e.g., not a backslash or a space. */   *      (e.g., not a backslash or a space. */
 static int skip_empty_lines_and_read_char(Buffer);  static int skip_empty_lines_and_read_char(Buffer);
   
   const char *curdir;
   size_t curdir_len;
   
   void
   Parse_setcurdir(const char *dir)
   {
           curdir = dir;
           curdir_len = strlen(dir);
   }
   
   static const char *
   simplify(const char *filename)
   {
           if (strncmp(curdir, filename, curdir_len) == 0 &&
               filename[curdir_len] == '/')
                   return filename + curdir_len + 1;
           else
                   return filename;
   }
   
 static struct input_stream *  static struct input_stream *
 new_input_file(const char *name, FILE *stream)  new_input_file(const char *name, FILE *stream)
 {  {
Line 125 
Line 145 
 #endif  #endif
   
         istream = emalloc(sizeof(*istream));          istream = emalloc(sizeof(*istream));
         istream->origin.fname = name;          istream->origin.fname = simplify(name);
         istream->str = NULL;          istream->str = NULL;
         /* Naturally enough, we start reading at line 0. */          /* Naturally enough, we start reading at line 0. */
         istream->origin.lineno = 0;          istream->origin.lineno = 0;

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29