Rework CR/LF skip code to be more consistent.

This commit is contained in:
Michael R Sweet
2023-10-06 14:41:55 -04:00
parent 12ef2fe2c3
commit b0e4646f9d
3 changed files with 6 additions and 7 deletions

View File

@ -1737,6 +1737,10 @@ load_xref(
return (false);
}
PDFIO_DEBUG("load_xref: tb.bufptr=%p, tb.bufend=%p, tb.bufptr[0]=0x%02x, tb.bufptr[0]=0x%02x\n", tb.bufptr, tb.bufend, tb.bufptr[0], tb.bufptr[1]);
if (tb.bufptr && tb.bufptr < tb.bufend && (tb.bufptr[0] == 0x0d || tb.bufptr[0] == 0x0a))
tb.bufptr ++; // Skip trailing CR or LF after token
_pdfioTokenFlush(&tb);
obj->stream_offset = _pdfioFileTell(pdf);