version 1.24, 1999/11/11 11:42:19 |
version 1.25, 1999/12/06 22:24:31 |
|
|
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); |
|
|
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'); |
|
|
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] == '.') |
|
|
* 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; |
|
|
/* |
/* |
* 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; |
|
|
} |
} |
|
|
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. |