C/A/T troff bug with -mm macros (4.3BSD)

Bill "Bill" Tuthill tut%cairo at Sun.COM
Sun Dec 17 09:58:28 AEST 1989


In <1989Dec16.133059.6190 at pcrat.uucp>, rick at pcrat.uucp (Rick Richardson) writes:
> In article <927 at hsi86.hsi.UUCP> stevens at hsi.UUCP (Richard Stevens) writes:
> >I have found a bug with the old C/A/T version of troff that's
> >shipped with 4.3BSD.  The bug shows up with the -mm macro
> >	MM page at start = 0
> >	
> >	 - 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 -
> 
> I believe this is because the MM macros use the \g (return register
> format) escape sequence, which does not exist in C/A/T troff.

It's easy enough to add support for \g -- even I could do it.  This was
many moons ago, so I hope these diffs are sufficient.

% sccs diffs -r1.3 n1.c
------- n1.c -------
613a620,622
>               case 'g':       /* return format of number reg */
>                       setaf();
>                       goto g0;

% sccs diffs -r1.3 n4.c
------- n4.c -------
481a505,519
> setaf()         /* return format of number register */
> {
>       register int i, j;
> 
>       if ((i = usedr(getsn())) == -1) /* no such register */
>               return;
>       cp = cbuf;
>       if (fmt[i] > 20)        /* probably a A i I */
>               *cp++ = fmt[i];
>       else
>               for (j = (fmt[i] ? fmt[i] : 1); j; j--)
>                       *cp++ = '0';
>       *cp = 0;
>       cp = cbuf;
> }



More information about the Comp.bugs.4bsd.ucb-fixes mailing list