Corrected an unexpected corner-case error in which if a newline in
a spice netlist falls exactly on the last non-null position of the input buffer after the buffer has been expanded to accept more input data, then the next line gets read in automatically, and the newline gets treated as whitespace and not a newline.
This commit is contained in:
parent
4443826f9e
commit
c269f1de89
|
|
@ -329,6 +329,11 @@ int GetNextLineNoNewline(char *delimiter)
|
|||
llen = strlen(line);
|
||||
}
|
||||
while (llen == linesize - 1) {
|
||||
/* Note that in the rare case where a newline is in the last buffer
|
||||
* position, we're done.
|
||||
*/
|
||||
if (*(line + llen - 1) == '\n') break;
|
||||
|
||||
newbuf = (char *)MALLOC(linesize + 501);
|
||||
strcpy(newbuf, line);
|
||||
FREE(line);
|
||||
|
|
|
|||
Loading…
Reference in New Issue