[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug] \~ can overwrite previous text.
From: |
G. Branden Robinson |
Subject: |
Re: [Bug] \~ can overwrite previous text. |
Date: |
Mon, 6 Mar 2023 11:46:41 -0600 |
Hi Alex,
At 2023-03-06T18:37:41+0100, Alejandro Colomar wrote:
> Am I in the right path with this?:
>
> $ ./troff -man -Tutf8 ~/tmp/space.man -rLL=60n 2>&1 | sed -n '/746/,/746/p'
> ALX: src/roff/troff/input.cpp:process():7462
> ALX: src/roff/troff/node.h:node():130
> ALX: src/roff/troff/node.cpp:space_node():3198
> ALX: src/roff/troff/node.cpp:word_space_node():4423
> ALX: src/roff/troff/node.cpp:unbreakable_space_node():4487
> ALX: src/roff/troff/input.cpp:process():7465
>
> Consider that those line numbers are including the debugging (fprintf(3))
> lines that I just added.
>
> Any other hints are appreciated. :)
You're close but not quite there, I _think_. (Until I've root-caused
this myself, or seen someone else's convincing demonstration, my
conclusions must be tentative ones.)
Because _ordinary_ spaces don't get squeezed, I would start at
`distribute_space()` in src/roff/troff/env.cpp and navigate up and down
the call stack from there.
static void distribute_space(node *n, int nspaces, hunits desired_space,
bool force_reverse_node_list = false)
Looking at it, I am reminded that there is a debugging knob of sorts
built in. You could turn on spreading warnings with the `.spreadwarn`
request.
I wonder if that function needs another assertion.
assert(desired_space > 0);
...or something like that. "0" might not be of the right type, since
`desired_space` is in `hunits`. (Hail strong typing! Hail!)
> Thanks for the link; I struggle finding what I need in savannah.
> It's hard to find the gazelle you're looking for :)
No one said the lion's life was easy. ;-)
Regards,
Branden
signature.asc
Description: PGP signature