diff options
-rw-r--r-- | Build/source/texk/web2c/luatexdir/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/mainbody.c | 10 |
2 files changed, 17 insertions, 0 deletions
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 <karl@freefriends.org> + + * 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 <karl@freefriends.org> * 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. |