commit 260c87942a668b5730e36de68b14fc7b62e17860 from: Sven M. Hallberg date: Mon Feb 10 17:56:29 2020 UTC note another accept-and-warn case commit - 39cb95f3d7cc41e247747e37afd05a9a6ce55115 commit + 260c87942a668b5730e36de68b14fc7b62e17860 blob - 2729f9a4718c973e826e9db1b385e75c41b7f1e9 blob + 8afa86866317dfb9b8900153ad23240fb8a17c30 --- pdf.c +++ pdf.c @@ -657,6 +657,12 @@ init_parser(struct Env *aux) H_RULE(startxr, SEQ(nl, KW("startxref"), nl, lws, nat, nl, LIT("%%EOF"), CHX(nl, end))); + // XXX the real world sometimes omits nl after %%EOF inside the file. + // the next 'tail' would be appended right after the 'F', + // presumably because the previous version of the file + // ended without a trailing newline. m) + // this is invalid per spec, because it creates a run-on + // comment, but we should probably accept-and-warn. // XXX should lws be allowed before EOF marker? // NB: lws before xref offset is allowed, cf. p.48 (example 4) H_RULE(xr_td, SEQ(xrefs, KW("trailer"), ws, dict));