diff --git a/VERSION b/VERSION index 07e5b5f..d898cef 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.296 +1.5.297 diff --git a/base/netfile.c b/base/netfile.c index 421acfa..e380777 100644 --- a/base/netfile.c +++ b/base/netfile.c @@ -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);