--- texi2dvi.orig 2009-10-26 13:55:49.658841311 +0100 +++ texi2dvi 2009-10-26 14:14:50.478841780 +0100 @@ -50,6 +50,7 @@ escape="\\" expand= # t for expansion via makeinfo includes= line_error=true # Pass --file-line-error to TeX. +max_iters=-1 # just keep going no_line_error=false # absolutely do not pass --file-line-error to TeX oname= # --output out_lang=dvi @@ -331,6 +332,7 @@ Build modes: defaults to TEXI2DVI_BUILD_DIRECTORY [$build_dir] --mostly-clean remove the auxiliary files and directories but not the output + --max-iterations=N don't process files more than N times The MODE specifies where the TeX compilation takes place, and, as a consequence, how auxiliary files are treated. The build mode @@ -1093,6 +1095,13 @@ run_tex_suite () local cycle=0 while :; do + # check for probably LaTeX loop (e.g. varioref) + if test $cycle -eq $max_iters; then + error 0 "Maximum of $max_iters cycles exceeded" + break + fi + + # report progress cycle=`expr $cycle + 1` verbose "Cycle $cycle for $command_line_filename" @@ -1524,6 +1533,7 @@ while test x"$1" != x"$arg_sep"; do -l | --lang | --language) shift; set_language=$1;; --mostly-clean) action=mostly-clean;; --no-line-error) no_line_error=true;; + --max-iterations) shift; max_iters=$1;; -o | --out | --output) shift # Make it absolute, just in case we also have --clean, or whatever.