From 4796b2cdf10a74e8714696028560ca95c6aeb7ac Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 17 Dec 2023 18:42:04 +0000 Subject: complain if more than 2^16 pages in dvi mode git-svn-id: svn://tug.org/texlive/trunk@69152 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/ChangeLog | 7 +++++++ Build/source/texk/web2c/luatexdir/tex/mainbody.c | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index 710f2ad5b84..a007788fced 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,10 @@ +2023-12-17 Karl Berry + + * tex/mainbody.c (close_files_and_terminate): complain if + more than 2^16 pages in DVI mode, since DVI format is limited + to that many. Report from Nasser Abbasi for tex4ht: + https://puszcza.gnu.org.ua/bugs/?618 + 2023-11-20 Karl Berry * luazlib/lzlib.c: relax zlib version check to just checking diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.c b/Build/source/texk/web2c/luatexdir/tex/mainbody.c index fd77be07137..066ca2866eb 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mainbody.c +++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.c @@ -650,6 +650,16 @@ void close_files_and_terminate(void) } } wake_up_terminal(); + /* DVI format only supports 2^16 pages. If we have more than that, + give an error. Original TeX does not, but nowadays people might + have larger files, especially with tex4ht, which makes profligate + use of pages, so it's useful to explicitly complain. + */ + if (get_o_mode() == OMODE_DVI && total_pages > 65536) { + formatted_error("dvi backend", + "more than 65536 pages is unsupported: %d", total_pages); + history = fatal_error_stop; + } /*tex Rubish, these \PDF arguments, passed, needs to be fixed, e.g. with a dummy in \DVI. -- cgit v1.2.3