groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] [OT] Patches for AT&T DWB and Heirloom troff


From: Steffen Nurpmeso
Subject: Re: [Groff] [OT] Patches for AT&T DWB and Heirloom troff
Date: Mon, 04 Aug 2014 17:33:38 +0200
User-agent: s-nail v14.7.5-1-g5138fe7

 |Heirloom troff:
 |
 |The Sourceforge version compiles on usual UNIX systems (but \
 |also with lots of shift/reduce errors) and also works as expected--except \
 |on OpenBSD.  There the binary crashes with 90% probability. \
 | Posts can be found about this issue but no solution for it. \
 | I have created a simple patch with which it works fine on \
 |OpenBSD too.  The issue is not OS dependend so it may cause \
 |functional problems on other systems too.

Indeed, it is not 64-bit safe (as in, returning pointer values in
an `int' etc.).

--steffen
--- Begin Message --- Subject: [Groff] [OT] Patches for AT&T DWB and Heirloom troff Date: Mon, 4 Aug 2014 17:01:28 +0200 (CEST)
Hello,

for those who are interested in other *roff distributions also I have patches 
for two of them: AT&T DWB from 1993 and Gunnars Heirloom troff.

AT&T DWB:

I don't know if it's well-known but the source of AT&T DWB from 1993 is 
available on http://www2.research.att.com/sw/download under EPL license.  I 
made some minimal changes to make it compile on OpenBSD, NetBSD and Linux.

There are still the usual warnings regarding sprintf and strcpy which I didn't 
care about in the first step.  Also there are a lot of shift/reduce and 
reduce/reduce warnings from yacc which I will look into next time, but a parser 
is generated and works for first tests.  Also there are some hacks to set an 
initial state for AT&T lex which I disabled, I will have to look into it also.

All book documents I had created in the past are generated with identical 
appearance like from Heirloom or Plan9 troff.  (There are few small differences 
to groff--at the moment I don't know which tool has the bug ;)

Of course this version may not have support for UTF-8 or identifiers longer 
than 2 characters (etc.).

If one is interessted I can send this patch.

Heirloom troff:

The Sourceforge version compiles on usual UNIX systems (but also with lots of 
shift/reduce errors) and also works as expected--except on OpenBSD.  There the 
binary crashes with 90% probability.  Posts can be found about this issue but 
no solution for it.  I have created a simple patch with which it works fine on 
OpenBSD too.  The issue is not OS dependend so it may cause functional problems 
on other systems too.

diff -rup ../a/heirloom-doctools/troff/troff.d/t10.c ./troff/troff.d/t10.c
--- ../a/heirloom-doctools/troff/troff.d/t10.c  Tue Aug 19 00:40:22 2008
+++ ./troff/troff.d/t10.c       Sun Jul 27 22:23:59 2014
@@ -223,6 +223,7 @@ ptinit(void)
        chtab = (short *)(pstab + nsizes + 1);
        chname = (char *) (chtab + dev.nchtab);
        p = chname + dev.lchname;
+       specnames();    /* install names like "hyphen", etc. */
        for (i = 1; i <= nfonts; i++) {
                fontbase[i] = (struct Font *) p;
                nw = *p & BYTEMASK;     /* 1st thing is width count */
@@ -265,7 +266,6 @@ ptinit(void)
        pts = pts2u(pts);
        pts1 = pts2u(pts1);
        ics = ICS;
-       specnames();    /* install names like "hyphen", etc. */
        for (i = 0; i <= nfonts; i++)
                setlig(i, fontbase[i]->ligfont);
        kern = xflag;

Cheers,
Carsten


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]