March 11, 1994 If we are just plain old nroff (and not doing UNICODE) we should only Lookup characters, not Install when we don't know them. If we are troff, we Install them anyway March 8, 1994 Nroff had problems with parsing quoted white space as options or character code in some terminals tables. Changed by having scanf include white space when necessary as suggested by Rich. March 1, 1994 Made sanity check for terminal type depending on the trace level; trace level set with -tn flag at start up 22 Feb, 1994 More pointer shuffling fixes. 18 Feb, 1994 More disabling of multibyte stuff. Fixed bug in n5.c: casetm didn' know about the new format in the fontables. Feb 17, 1994 Removed extra include <setlocale> from n1.c Fixed dubious pointer shuffling in n7.c, t10.c & n8.c. Thanks Rich! Feb 10, 1994 Disabled the multybyte stuff; only plan 9 will get it. Jan 24, 1994 Fixed nasty bug discovered by td, which caused core dumps on \D'l-0.002775i 0i' and apparently all numbers closer to 0 than -.002775. Fixed in storeline() and storeword() (n7.c). Dec 16, 1993 nroff & troff -N were looking for the TYPESETTER variable, causing troff: cannot open /sys/lib/troff/term/tab.202; line 1, file stdin fixed my moving getenv("TYPESETTER") to t10.c in t_ptinit(void). Dec 3, 1993: The sequence \s+2\H'+10' came sometimes out in the wrong order (x H before s), so there wasn't a difference bewteen \s+2\H'+10' and \H'+10'\s+2. Now the fonts bits of the CHARHT are used to register the current pontsize, so we can issue a s10 in t10.c if needed. A bit sneaky. Try to prevent double slashes in path names. Especially under plan9 things started to look ugly. Exception word list now grows dynamic. Nov 30, 1993: Allow multiple calls to .pi, requested by Rob. .pi cat .pi dogs is now equivalent with .pi cat | dogs .ab now takes also optional error code: .ab [n] [string] If n and string, n is exit code, string is message If n, n is exit code, ``User Abort, exit code n" is message If !n and string, standard exit code, string is message If !n and ! string, standard exit code, "User Abort" is message Nov 24, 1993: Reordered code to keep the UNASNI scripts happy. Nroff dumped core reading terminal tables: apparenty under plan 9, scanf includes the '\n'; added test for '\0' in parse in n10.c. Relative tab settings (.ta +1C +2C) didn't work; anding the previous value with TABMASK fixes this (caseta). Nov 23, 1993: Included code, originally done by bwk for plan 9, to handle multi-byte characters. Nov 3, 1993: ``pair internal'' two char names by shifting 16 bits. Will allow the use of 16 bit characters sets (Unicode in plan9 etc.) for macro's etc. Oct 20, 1993: Word & line buffers are now dynamic: No more word or line overflow unless when we run out of memory. Oct 11, 1993: lost diversion warning pops up regularly with man macro's. Due to a possible macro coding problem. Triggered by something like troff -man: .TP .TP foo .ex Minimal code: .di aa throw away this diversion (aa) while being defined. .rm aa .br .di Fixed by disallowing .rm to throw away current diversion. The rn request will complain with: cannot remove diversion aa during definition; etc. Sep 29, 1993: Some long standing fixes which never went back in the source. Thanks to Janet & Rich. Sep 28, 1993: Changed getach() (n1.c), so it does't consider truncated special characters as (8-bit) ascii. STX ETX ENQ ACK and BELL are still allowed for the ultimate backwards compatibility. Some code changes, so real ANSI compilers like the SGI version (acc from Sun is a poor excuse for an ANSI compiler) don't barf. Some compromises (static Tchar wbuf in n9.c) allowed so the unansified stuff for non-ansi compilers (cc on Sun's) will work as well. Sep 9, 1993: Be nice to Gerard. Now also word spaces in .tl and after tabs/fleids etc. Aug 12, 1993: Tabs setting can now be humongous. We also allow 99 tabs to accomodate tbl. As a side effect, NTM buffers are now 1K Aug 11, 1993: .R register, now contains maximum number of addessable registers minus the number actually used. Small esthetic changes in error messages; removed a statement which wasn't reached anyway. Aug 10, 1993: Some more speed hacks: be smarter doing the linear table lookups in alloc() and finds(). The real name of the det diversion size macro is now gd. Aug 9, 1993: A much faster way to find the end of a string/macro, by remembering that when defined. Aug 6, 1993: Slightly more eficient way of skipping to the end of a string/macro Aug 5, 1993: Prevent character sign extension for 8-bit charnames diversions etc. by unpair Aug 4, 1993: Growing the dynamical macro/strings name space and registers space (See the experiment of 21 July) now with bigger increments. Casts added to satisfy non-ANSI compilers. Aug 3, 1993: Should check return value in alloc (n3.c), to prevent core dump when memory gets tight. July 28, 1993: New request: .sg <div> sets the dn and dl registers to the size of the diversion named in the argument. Doesn't do anything when the named diversion doesn't exist. The name sg is temporary until we find a better one. July 21, 1993: Experiment: Macro space & registers name allocated dynamically. Note that current reallocation occurs in increments of 1, to force the code to be executed a lot; a kind of stress testing. Also, eight bit characters allowed in macro/string names. July 21, 1993: Turn on the escape mode if the end macro is called. July 20, 1993: Tracing mode now default off Don't print s stackdump either when a file specfied on the command line argument cannot be opened July 15, 1993: Don't print useless line & current file informations when a file specfied on the command line argument cannot be opened. Sun ansi compiler doesn't default adhere to standards. Undid the kludge in tdef.h July 14, 1993: Coding error made the tab type R not function properly July 12, 1993: Fixed a typo in the version stuff, noticed by Rich July 9, 1993: Added the dwb home configuration stuff, thanks RIch. Also, NCHARS is big enough. Added a fflush to casetm, so .fm <file> will be up to date. June 25, 1993 (Rich): -t option reinstated for the sake of compatibility. Some old shells scripts and man(1) from SunOs want this, sigh Compiler and system dependencies Some systems pull in sys/types.h via #include <time.h> and then the compiler complains about two ushort typedefs. Therefore, ushort is now Ushort (and uchar Uchar). The SVID specifies a strdup, POSIX doesn't, anyway, troff provides its own version, slightly different then the standard one. A To prevent name clashes with that definion, renamed to strdupl. June 24, 1993 (Rich): -V option added for DWB3.4 (rich) May 18, 1993: Trivial fix (.cf) request for troff -a issuing .cf /dev/null with troff -a gives some spurious output: H720 H720 s10 f1 fixed by checking for ascii mode it ptesc(), ptps() and ptfont() in t10.c Enhancement Added a .tm request to roff. Works just like .tm, but now it will do it to file. The name is coined by Carmela. Great for creating indeces & toc's (we hope). May 18 1993: Compatibilty change Somebody complained that his favorite macro didn't work: it had a BELL (^G) in the name. This was a non-documented feature of earlier versions of troff (although the documentation actually doesn't say that you can. (They can only be used for delimiters or with the tr request), so it isn't that important). But the sake of eternal backward compatibilaty I allowed some control characters like, STX, ACK, etc. also be part of a macro/string name. While at it, I made it also possible to have eight bit characters be part of the name. It might be that this screws up the way users think about these things. For UNICODE versions, they probably want to do that as well, and that won't work as easy, (because these characters are 16-bits wide), so it is dubious whether we actually want this. BTW. Now .de \(ts\ts .tm terminal sigma macro .. .\(ts\(ts also works, as long the internal cookie for ts isn't more then eight bits. May 12, 1993: Syntax change Some requests accept tabs as a separator, some don't and this can be a nuisance. Now a tab is also recognized as an argument separator for requests, this makes .so /dev/null works. To be more precise, any motion character is allowed, so .so\h'5i'/dev/null will work as well, if one really wants that. It will be a problem for users who really relied on this as in .ds x string and expect the tab to become part of the string a, but I haven't seen any use of that (obscure trick). May 6, 1993: Eileen count fixed Troff sometimes went in a loop, and exited with: ``job looping; check abuse of macros'' (also known as the Eileen's loop). It can be forced with the next trivial programme: .de ff .di xx .. .wh -1 ff .bp Basically what happens is that a page transition now will happen in a diversion, which doesn't make sense. Wat really happens is that eject() (in n7.c) doesn't eject the frame because we are in a diversion. This cause the loop in n1.c (because now always stack->pname <= ejl). Adding check on whether we are not in a diversion takes care of the problem. March 30, 1993: Need request, .ne When there is a begin of page trap set, and the first thing in the file is a .ne request, the trap gets fired, but, the x font R etc. cookies doen't come out, because the troff thinks that the first page pseudo transition already took place. Fixed by forcing the start of the first page in the casene request with the same code as in casetl (which caused a similar problem quite some time ago). Change to .cf request ``Here document'' If the argument of .cf starts with a <<, the rest of it is taken as an EOF token. It will reat the rest of the input until it hits the EOF token and copies it to the output. This is similar as the shell's ``here document'' mechanisme and put in place to improve the kludgy way picasso, picpack etc. now include postscript. Using troff -TLatin1 (DWB version) and \N'...' caused core dump In t11, in chadd, it should test on NCHARS - ALPHABET to see whether we run out of table space (and we probably should beaf up NCHARS for the DWB version). March 16, 1993: Diversion rename bug fix It is possible to get troff in an infinite loop by renaming a diversion in progress, and calling it later with the new name (as in .di xx, .rn xx yy, .yy). The effect depends on whether troff already put stuff in the diversion or not. Fix by having .rn also rename the current diversion (if there is any and when appropriate). If the diversion calls itself by the new name and given the fix made on 11 nov 1992, this will now result in an error. (BTW, the fix from 11 nov is improved: diversions nest, so we have to account for that). December 18, 1992: Some people have complete novels as comments, so we need to skip comments while checking the legality of font files. thaks Rixh December 16, 1992 Some people rely on the order that -r arguments are given, so that troff -rC1 -rC3 ends up setting register C to 3. Because cpushback() pushes things in a LIFO order back, we have to do the same to get -r args in a FIFO order. Nov 17, 1992: Giving a -rL8 option cuased the string .nr L 8 to be printed on the output, using the wonderful 3b2. Some garbage was left in buf[100] in main(). Fixed by setting buf[0] explicitly to 0 (because some C-compilers complain about ``no automatic aggregate initialization''). Nov 11, 1992: Diversion bug fix If a diversion was being read and the input is faulty so the diversion was reading in itself, it caused troff to loop undefinitely. This was easily fixed by a test in control(a,b) in n1.c. Something similar things might happen with macros causing the ``eileenct problem'', but I didn't look for that. We have to wait until it happens. Oct 26, 1992: Numeric arguments: Illegal argments are treated as missing arguments. This changed the semantics of .ll, .ls, .in, .lg, .ul, .cu .lt (which acted as if the argument was 0) and .ps which was simply ignored with an illegal argument. Tidied up number parsing in atoi1(). This prevents arguments like .x or 1.2.3.4 being interpret as a legal number (nonumb = 0) Numeric arguments error reporting: Controlled by .pt, illegal numbers are now reported (default trace mode is 1). This is also true for the escapes: \h'..', \v'..' \H'..', \S'..', \N'..', \D'..', \l'.., \L'.. and \x'..'. \D'c' is the only drawing request which doesn't take a pair of numbers as arguments, so a special case is put here in setdraw() (This code actually could use an overhaul to get better parsing. As long as the \D'..' cookies are machine generated it is low on the priority list). Don't generate an error if the illegal argument to a request is a \}. It is too painful to do right (although it can be done, but it would clutter getch() and getcho() even more). Input line numbers (.c register) bug fixes: In not taken branches of .if or .ie, the input line # (numtab[CD].val) should be raised when necessary (in eatblk()). For concealed newlines, we still should count the line for input. Setfield (n9.c) sometimes pushes the rest of the line back to the input (including \n), without adjusting numtab[CD].val Because .c (and so numtab[CD].val) is the number of lines read and the error might actually happen in the current line (before seeing the '\n), we need to apply correction in errprint when nlflg set. (This correction needs to be undone when inside a macro because the nlflg is set by reading the args to the macro). Line number setting (.lf) request bug fixes: I interpret that the .c register will contain the number of read lines, not including the current one. Also, don't change the input line number when the first argument of .lf is not a number. As a net effect, the next input .EQLines 1–500 of 821. Load more
March 11, 1994 If we are just plain old nroff (and not doing UNICODE) we should only Lookup characters, not Install when we don't know them. If we are troff, we Install them anyway March 8, 1994 Nroff had problems with parsing quoted white space as options or character code in some terminals tables. Changed by having scanf include white space when necessary as suggested by Rich. March 1, 1994 Made sanity check for terminal type depending on the trace level; trace level set with -tn flag at start up 22 Feb, 1994 More pointer shuffling fixes. 18 Feb, 1994 More disabling of multibyte stuff. Fixed bug in n5.c: casetm didn' know about the new format in the fontables. Feb 17, 1994 Removed extra include <setlocale> from n1.c Fixed dubious pointer shuffling in n7.c, t10.c & n8.c. Thanks Rich! Feb 10, 1994 Disabled the multybyte stuff; only plan 9 will get it. Jan 24, 1994 Fixed nasty bug discovered by td, which caused core dumps on \D'l-0.002775i 0i' and apparently all numbers closer to 0 than -.002775. Fixed in storeline() and storeword() (n7.c). Dec 16, 1993 nroff & troff -N were looking for the TYPESETTER variable, causing troff: cannot open /sys/lib/troff/term/tab.202; line 1, file stdin fixed my moving getenv("TYPESETTER") to t10.c in t_ptinit(void). Dec 3, 1993: The sequence \s+2\H'+10' came sometimes out in the wrong order (x H before s), so there wasn't a difference bewteen \s+2\H'+10' and \H'+10'\s+2. Now the fonts bits of the CHARHT are used to register the current pontsize, so we can issue a s10 in t10.c if needed. A bit sneaky. Try to prevent double slashes in path names. Especially under plan9 things started to look ugly. Exception word list now grows dynamic. Nov 30, 1993: Allow multiple calls to .pi, requested by Rob. .pi cat .pi dogs is now equivalent with .pi cat | dogs .ab now takes also optional error code: .ab [n] [string] If n and string, n is exit code, string is message If n, n is exit code, ``User Abort, exit code n" is message If !n and string, standard exit code, string is message If !n and ! string, standard exit code, "User Abort" is message Nov 24, 1993: Reordered code to keep the UNASNI scripts happy. Nroff dumped core reading terminal tables: apparenty under plan 9, scanf includes the '\n'; added test for '\0' in parse in n10.c. Relative tab settings (.ta +1C +2C) didn't work; anding the previous value with TABMASK fixes this (caseta). Nov 23, 1993: Included code, originally done by bwk for plan 9, to handle multi-byte characters. Nov 3, 1993: ``pair internal'' two char names by shifting 16 bits. Will allow the use of 16 bit characters sets (Unicode in plan9 etc.) for macro's etc. Oct 20, 1993: Word & line buffers are now dynamic: No more word or line overflow unless when we run out of memory. Oct 11, 1993: lost diversion warning pops up regularly with man macro's. Due to a possible macro coding problem. Triggered by something like troff -man: .TP .TP foo .ex Minimal code: .di aa throw away this diversion (aa) while being defined. .rm aa .br .di Fixed by disallowing .rm to throw away current diversion. The rn request will complain with: cannot remove diversion aa during definition; etc. Sep 29, 1993: Some long standing fixes which never went back in the source. Thanks to Janet & Rich. Sep 28, 1993: Changed getach() (n1.c), so it does't consider truncated special characters as (8-bit) ascii. STX ETX ENQ ACK and BELL are still allowed for the ultimate backwards compatibility. Some code changes, so real ANSI compilers like the SGI version (acc from Sun is a poor excuse for an ANSI compiler) don't barf. Some compromises (static Tchar wbuf in n9.c) allowed so the unansified stuff for non-ansi compilers (cc on Sun's) will work as well. Sep 9, 1993: Be nice to Gerard. Now also word spaces in .tl and after tabs/fleids etc. Aug 12, 1993: Tabs setting can now be humongous. We also allow 99 tabs to accomodate tbl. As a side effect, NTM buffers are now 1K Aug 11, 1993: .R register, now contains maximum number of addessable registers minus the number actually used. Small esthetic changes in error messages; removed a statement which wasn't reached anyway. Aug 10, 1993: Some more speed hacks: be smarter doing the linear table lookups in alloc() and finds(). The real name of the det diversion size macro is now gd. Aug 9, 1993: A much faster way to find the end of a string/macro, by remembering that when defined. Aug 6, 1993: Slightly more eficient way of skipping to the end of a string/macro Aug 5, 1993: Prevent character sign extension for 8-bit charnames diversions etc. by unpair Aug 4, 1993: Growing the dynamical macro/strings name space and registers space (See the experiment of 21 July) now with bigger increments. Casts added to satisfy non-ANSI compilers. Aug 3, 1993: Should check return value in alloc (n3.c), to prevent core dump when memory gets tight. July 28, 1993: New request: .sg <div> sets the dn and dl registers to the size of the diversion named in the argument. Doesn't do anything when the named diversion doesn't exist. The name sg is temporary until we find a better one. July 21, 1993: Experiment: Macro space & registers name allocated dynamically. Note that current reallocation occurs in increments of 1, to force the code to be executed a lot; a kind of stress testing. Also, eight bit characters allowed in macro/string names. July 21, 1993: Turn on the escape mode if the end macro is called. July 20, 1993: Tracing mode now default off Don't print s stackdump either when a file specfied on the command line argument cannot be opened July 15, 1993: Don't print useless line & current file informations when a file specfied on the command line argument cannot be opened. Sun ansi compiler doesn't default adhere to standards. Undid the kludge in tdef.h July 14, 1993: Coding error made the tab type R not function properly July 12, 1993: Fixed a typo in the version stuff, noticed by Rich July 9, 1993: Added the dwb home configuration stuff, thanks RIch. Also, NCHARS is big enough. Added a fflush to casetm, so .fm <file> will be up to date. June 25, 1993 (Rich): -t option reinstated for the sake of compatibility. Some old shells scripts and man(1) from SunOs want this, sigh Compiler and system dependencies Some systems pull in sys/types.h via #include <time.h> and then the compiler complains about two ushort typedefs. Therefore, ushort is now Ushort (and uchar Uchar). The SVID specifies a strdup, POSIX doesn't, anyway, troff provides its own version, slightly different then the standard one. A To prevent name clashes with that definion, renamed to strdupl. June 24, 1993 (Rich): -V option added for DWB3.4 (rich) May 18, 1993: Trivial fix (.cf) request for troff -a issuing .cf /dev/null with troff -a gives some spurious output: H720 H720 s10 f1 fixed by checking for ascii mode it ptesc(), ptps() and ptfont() in t10.c Enhancement Added a .tm request to roff. Works just like .tm, but now it will do it to file. The name is coined by Carmela. Great for creating indeces & toc's (we hope). May 18 1993: Compatibilty change Somebody complained that his favorite macro didn't work: it had a BELL (^G) in the name. This was a non-documented feature of earlier versions of troff (although the documentation actually doesn't say that you can. (They can only be used for delimiters or with the tr request), so it isn't that important). But the sake of eternal backward compatibilaty I allowed some control characters like, STX, ACK, etc. also be part of a macro/string name. While at it, I made it also possible to have eight bit characters be part of the name. It might be that this screws up the way users think about these things. For UNICODE versions, they probably want to do that as well, and that won't work as easy, (because these characters are 16-bits wide), so it is dubious whether we actually want this. BTW. Now .de \(ts\ts .tm terminal sigma macro .. .\(ts\(ts also works, as long the internal cookie for ts isn't more then eight bits. May 12, 1993: Syntax change Some requests accept tabs as a separator, some don't and this can be a nuisance. Now a tab is also recognized as an argument separator for requests, this makes .so /dev/null works. To be more precise, any motion character is allowed, so .so\h'5i'/dev/null will work as well, if one really wants that. It will be a problem for users who really relied on this as in .ds x string and expect the tab to become part of the string a, but I haven't seen any use of that (obscure trick). May 6, 1993: Eileen count fixed Troff sometimes went in a loop, and exited with: ``job looping; check abuse of macros'' (also known as the Eileen's loop). It can be forced with the next trivial programme: .de ff .di xx .. .wh -1 ff .bp Basically what happens is that a page transition now will happen in a diversion, which doesn't make sense. Wat really happens is that eject() (in n7.c) doesn't eject the frame because we are in a diversion. This cause the loop in n1.c (because now always stack->pname <= ejl). Adding check on whether we are not in a diversion takes care of the problem. March 30, 1993: Need request, .ne When there is a begin of page trap set, and the first thing in the file is a .ne request, the trap gets fired, but, the x font R etc. cookies doen't come out, because the troff thinks that the first page pseudo transition already took place. Fixed by forcing the start of the first page in the casene request with the same code as in casetl (which caused a similar problem quite some time ago). Change to .cf request ``Here document'' If the argument of .cf starts with a <<, the rest of it is taken as an EOF token. It will reat the rest of the input until it hits the EOF token and copies it to the output. This is similar as the shell's ``here document'' mechanisme and put in place to improve the kludgy way picasso, picpack etc. now include postscript. Using troff -TLatin1 (DWB version) and \N'...' caused core dump In t11, in chadd, it should test on NCHARS - ALPHABET to see whether we run out of table space (and we probably should beaf up NCHARS for the DWB version). March 16, 1993: Diversion rename bug fix It is possible to get troff in an infinite loop by renaming a diversion in progress, and calling it later with the new name (as in .di xx, .rn xx yy, .yy). The effect depends on whether troff already put stuff in the diversion or not. Fix by having .rn also rename the current diversion (if there is any and when appropriate). If the diversion calls itself by the new name and given the fix made on 11 nov 1992, this will now result in an error. (BTW, the fix from 11 nov is improved: diversions nest, so we have to account for that). December 18, 1992: Some people have complete novels as comments, so we need to skip comments while checking the legality of font files. thaks Rixh December 16, 1992 Some people rely on the order that -r arguments are given, so that troff -rC1 -rC3 ends up setting register C to 3. Because cpushback() pushes things in a LIFO order back, we have to do the same to get -r args in a FIFO order. Nov 17, 1992: Giving a -rL8 option cuased the string .nr L 8 to be printed on the output, using the wonderful 3b2. Some garbage was left in buf[100] in main(). Fixed by setting buf[0] explicitly to 0 (because some C-compilers complain about ``no automatic aggregate initialization''). Nov 11, 1992: Diversion bug fix If a diversion was being read and the input is faulty so the diversion was reading in itself, it caused troff to loop undefinitely. This was easily fixed by a test in control(a,b) in n1.c. Something similar things might happen with macros causing the ``eileenct problem'', but I didn't look for that. We have to wait until it happens. Oct 26, 1992: Numeric arguments: Illegal argments are treated as missing arguments. This changed the semantics of .ll, .ls, .in, .lg, .ul, .cu .lt (which acted as if the argument was 0) and .ps which was simply ignored with an illegal argument. Tidied up number parsing in atoi1(). This prevents arguments like .x or 1.2.3.4 being interpret as a legal number (nonumb = 0) Numeric arguments error reporting: Controlled by .pt, illegal numbers are now reported (default trace mode is 1). This is also true for the escapes: \h'..', \v'..' \H'..', \S'..', \N'..', \D'..', \l'.., \L'.. and \x'..'. \D'c' is the only drawing request which doesn't take a pair of numbers as arguments, so a special case is put here in setdraw() (This code actually could use an overhaul to get better parsing. As long as the \D'..' cookies are machine generated it is low on the priority list). Don't generate an error if the illegal argument to a request is a \}. It is too painful to do right (although it can be done, but it would clutter getch() and getcho() even more). Input line numbers (.c register) bug fixes: In not taken branches of .if or .ie, the input line # (numtab[CD].val) should be raised when necessary (in eatblk()). For concealed newlines, we still should count the line for input. Setfield (n9.c) sometimes pushes the rest of the line back to the input (including \n), without adjusting numtab[CD].val Because .c (and so numtab[CD].val) is the number of lines read and the error might actually happen in the current line (before seeing the '\n), we need to apply correction in errprint when nlflg set. (This correction needs to be undone when inside a macro because the nlflg is set by reading the args to the macro). Line number setting (.lf) request bug fixes: I interpret that the .c register will contain the number of read lines, not including the current one. Also, don't change the input line number when the first argument of .lf is not a number. As a net effect, the next input .EQ