[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.24 and 1.25

version 1.24, 1999/11/11 11:42:19 version 1.25, 1999/12/06 22:24:31
Line 2105 
Line 2105 
     int skip;           /* Skip lines that don't start with . */      int skip;           /* Skip lines that don't start with . */
 {  {
     char *line;      char *line;
     int c, lastc, lineLength = 0;      int c, lastc;
       size_t lineLength = 0;
     Buffer buf;      Buffer buf;
   
     buf = Buf_Init(MAKE_BSIZE);      buf = Buf_Init(MAKE_BSIZE);
Line 2117 
Line 2118 
         while (((c = ParseReadc()) != '\n' || lastc == '\\')          while (((c = ParseReadc()) != '\n' || lastc == '\\')
                && c != EOF) {                 && c != EOF) {
             if (c == '\n') {              if (c == '\n') {
                 Buf_ReplaceLastByte(buf, (Byte)' ');                  Buf_ReplaceLastChar(buf, ' ');
                 lineno++;                  lineno++;
   
                 while ((c = ParseReadc()) == ' ' || c == '\t');                  while ((c = ParseReadc()) == ' ' || c == '\t');
Line 2126 
Line 2127 
                     break;                      break;
             }              }
   
             Buf_AddByte(buf, (Byte)c);              Buf_AddChar(buf, c);
             lastc = c;              lastc = c;
         }          }
   
         Buf_AddByte(buf, (Byte)'\0');          Buf_AddChar(buf, '\0');
         line = (char *)Buf_GetAll(buf, &lineLength);          line = Buf_GetAll(buf, &lineLength);
         lineno++;          lineno++;
             /* allow for non-newline terminated lines while skipping */              /* allow for non-newline terminated lines while skipping */
         if (line[0] == '.')          if (line[0] == '.')
Line 2182 
Line 2183 
                                  * shell command */                                   * shell command */
     char          *line;        /* Result */      char          *line;        /* Result */
     char          *ep;          /* to strip trailing blanks */      char          *ep;          /* to strip trailing blanks */
     int           lineLength;   /* Length of result */  
   
     semiNL = FALSE;      semiNL = FALSE;
     ignDepOp = FALSE;      ignDepOp = FALSE;
Line 2330 
Line 2330 
             /*              /*
              * Copy in the previous character and save this one in lastc.               * Copy in the previous character and save this one in lastc.
              */               */
             Buf_AddByte (buf, (Byte)lastc);              Buf_AddChar(buf, lastc);
             lastc = c;              lastc = c;
   
         }          }
Line 2338 
Line 2338 
         lineno++;          lineno++;
   
         if (lastc != '\0') {          if (lastc != '\0') {
             Buf_AddByte (buf, (Byte)lastc);              Buf_AddChar(buf, lastc);
         }          }
         Buf_AddByte (buf, (Byte)'\0');          Buf_AddChar(buf, '\0');
         line = (char *)Buf_GetAll (buf, &lineLength);          line = Buf_GetAll(buf, NULL);
         Buf_Destroy (buf, FALSE);          Buf_Destroy(buf, FALSE);
   
         /*          /*
          * Strip trailing blanks and tabs from the line.           * Strip trailing blanks and tabs from the line.

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25