47e2de639124cff904c911e6e12baf596d32e91f angie Tue Jun 7 16:41:51 2022 -0700 Braney code review suggestion: don't enforce an arbitrary line size limit, just keep going until & unless we run out of memory. refs #29551 diff --git src/lib/linefile.c src/lib/linefile.c index 9c951a3..2230c66 100644 --- src/lib/linefile.c +++ src/lib/linefile.c @@ -630,42 +630,34 @@ { lf->bytesInBuf = lf->lineStart = lf->lineEnd = 0; return FALSE; } else endIx = sizeLeft; bytesInBuf = lf->bytesInBuf = readSize + sizeLeft; lf->lineEnd = 0; determineNlType(lf, buf+endIx, bytesInBuf-endIx); gotLf = findNextNewline(lf, buf, bytesInBuf, &endIx); if (!gotLf && bytesInBuf == lf->bufSize) { - if (bufSize >= 1024*1024*1024) - { - errAbort("Line too long (more than %d chars) line %d of %s", - lf->bufSize, lf->lineIx+1, lf->fileName); - } - else - { lineFileExpandBuf(lf, bufSize*2); buf = lf->buf; } } - } if (lf->zTerm) { buf[endIx-1] = 0; if ((lf->nlType == nlt_dos) && (buf[endIx-2]=='\r')) { buf[endIx-2] = 0; } } lf->lineStart = newStart = lf->lineEnd; lf->lineEnd = endIx; ++lf->lineIx; if (retSize != NULL) *retSize = endIx - newStart;