git: 9front

Download patch

ref: cdf8c1bcb85f3e3229fff69269c07c06f373c099
parent: 06ac3cf30beeb3a284ac9f6d23c4121036355c10
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jan 23 16:28:22 EST 2019

troff: fix -ms mug (thanks aksr)

Executing .KS after .1C exhibits a bug.
Instead on the next page, the text between .KS and .KE is shown at
the bottom of the page (where footnote would be).
To reproduce the bug: http://sprunge.us/xyCUX7

The bug can be fixed by changing two lines in tmac.s:

    if \\n(NX<1 .bp\}

to

    if \\n(NX<=1 .bp\}

and

    if \\n(NX<1 'bp\}
to

  if \\n(NX<=1 'bp\}

--- a/sys/lib/tmac/tmac.s
+++ b/sys/lib/tmac/tmac.s
@@ -972,7 +972,7 @@
 .fi
 .if (\\n(nl+1v)>(\\n(.p-\\n(FM) \{\
 .	if \\n(NX>1 .RC
-.	if \\n(NX<1 .bp\}
+.	if \\n(NX<=1 .bp\}
 .nr TD 0
 ..
 .de KD
@@ -1020,7 +1020,7 @@
 .if !\\n(dn .nr WF 0
 .if \\n(FC<=1 .if \\n(XX=0 \{\
 .	if \\n(NX>1 .RC
-.	if \\n(NX<1 'bp\}
+.	if \\n(NX<=1 'bp\}
 .nr FC -1
 .if \\n(ML>0 .ne \\n(MLu
 ..
--