If .substring stop index is beyond the end of the string, the loop iterating to obtain the substring seems to process one extra character. Depending on various circumstances, this can have either:
no effect
wrong text output
segmentation fault
The following test document, when repeated multiple times, on my computer produces all of these 3 outcomes.
.do xflag 3
.mediasize 100p 100p
.lc_ctype ro_RO.UTF-8
.fp 1 R texgyreschola-regular otf
.po 10p
.ll 40p
.ds S abcd
.substring S 1 100
\*S
.substring S 1 100
\*S
.br
Expected output: "bcd cd".
P.S. Is just a pull request OK, or should it be accompanied with an open issue?
If
.substring
stop index is beyond the end of the string, the loop iterating to obtain the substring seems to process one extra character. Depending on various circumstances, this can have either:The following test document, when repeated multiple times, on my computer produces all of these 3 outcomes.
Expected output: "bcd cd".
P.S. Is just a pull request OK, or should it be accompanied with an open issue?