summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-12-17 18:42:04 +0000
committerKarl Berry <karl@freefriends.org>2023-12-17 18:42:04 +0000
commit4796b2cdf10a74e8714696028560ca95c6aeb7ac (patch)
treed1553c371da863d440bc41970182ac9c2e75ee3b
parent423ee6bef2fff13798480e30cb3d3318a4a9d3fc (diff)
complain if more than 2^16 pages in dvi mode
git-svn-id: svn://tug.org/texlive/trunk@69152 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mainbody.c10
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.