[luatex] A bug in show_context second line indentation

luigi scarso luigi.scarso at gmail.com
Fri Oct 18 11:46:04 CEST 2024


On Thu, 17 Oct 2024 at 18:06, user202729--- via luatex <luatex at tug.org>
wrote:

> Hi, can I get an update on this?
>
> Anyway, I think the short version is you can just apply this patch:
>
> ```
> diff --git a/source/texk/web2c/luatexdir/tex/printing.c
> b/source/texk/web2c/luatexdir/tex/printing.c
> index 8a52700..8ae11b4 100644
> --- a/source/texk/web2c/luatexdir/tex/printing.c
> +++ b/source/texk/web2c/luatexdir/tex/printing.c
> @@ -482,7 +482,8 @@ void tprint(const char *sss)
>      }
>      /*tex What is left is the 3 term/log settings. */
>      if (dolog || doterm) {
> -        buffer = xmalloc(strlen(sss)*3);
> +        size_t len = strlen(sss);
> +        buffer = xmalloc(len*3);
>          buffer[0] = '\0';
>          /*tex The |wrapup_run| callback acts when the log file is already
> closed.*/
>          if (dolog && log_opened_global) {
> @@ -532,6 +533,7 @@ void tprint(const char *sss)
>                  fputs(buffer, term_out);
>              }
>          }
> +        tally += len;
>          free(buffer);
>      }
>  }
> ```
>
> This is a test file
>
> ```tex
> \errorcontextlines=10000
> \def\c{1 \errorerror 2}
> \def\b #1 {7 #1 8}
> \def\a{5 \b {3 \c 4} 6}
> \hbox{7 \a 8}
> \stop
> ```
>

Still looking at it, but I don't exclude that I will apply your patch.

--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20241018/f14c38a0/attachment.htm>


More information about the luatex mailing list.