aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/troff
Commit message (Collapse)AuthorAgeFilesLines
* troff: fix SIGFPE when using modulus operatorG. Branden Robinson2025-11-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I uncovered this problem while writing unit tests for GNU troff's delimited expression handling. Plan 9 troff's numeric expression evaluator handles division by zero but not modulus by zero. Fixes: $ echo '.if %0%0% .tm true' | 9 troff Floating point exception (core dumped) $ echo '.if 1%0 .tm true' | 9 troff Floating point exception (core dumped) After this patch: $ echo '.if %0%0% .tm true' | 9 troff x T utf x res 720 1 1 x init troff: modulus by zero.; stdin:1 troff: modulus by zero.; stdin:1 x trailer V0 x stop $ echo '.if 1%0 .tm true' | 9 troff x T utf x res 720 1 1 x init troff: modulus by zero.; stdin:1 x trailer V0 x stop
* nroff: bad symbold definition on command line.Dan Cross2025-10-101-1/+1
| | | | | | | `-DTDEVNAME=...` should be `-DNDEVNAME=...`. We've been defaulting for "37", probably forever. Signed-off-by: Dan Cross <cross@gajendra.net>
* warnings: fix warnings on newer compilersDan Cross2025-07-241-11/+15
| | | | | | | | | | Mostly turning the crank on fixing simple warnings: arrays, for instance, can never be nil. A couple of pointers should have been initialized to `nil` before being tested. Some logic in `troff` was simplified: basically, an `if` statement had a condition that must have always been true if that section of code were being executed at all.
* troff: support `\~` as an alias for `\ ` (#567)g-branden-robinson2022-08-121-0/+2
| | | | | | | | | | | | | | In groff, Heirloom Doctools troff, and neatroff, the `\~` escape sequence produces an adjustable (paddable) but unbreakable space. mandoc, which does not perform adjustment or render to typesetters, supports the escape sequence as a synonym for `\ `, the same as `\0`. This extension is of long pedigree: groff has supported it for at least 30 years, Heirloom for 17, mandoc for 13, and neatroff for 6. Do the same as mandoc to prevent mis-rendering of documents using this escape sequence. Heirloom Doctools troff, a descendant of Documenter's Workbench troff, would be a good place to look for a compatible implementation of the adjustable semantics for this sequence.
* all: fix or silence various gcc warningsRuss Cox2020-01-121-3/+3
| | | | | As usual, gcc finds some real problems but also reports a ton of noise. Fix the problems and quiet the noise.
* Trivial changes: whitespace and modes.Dan Cross2020-01-1018-122/+118
| | | | | | | | | Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
* all: remove .cvsignore filesKare Nuorteva2017-09-141-1/+0
| | | | | | | | | | Rename following .cvsignore files to .gitkeep since they are required by the build (directories must exist before build): - bin/fossil/.gitkeep - bin/fs/.gitkeep - bin/venti/.gitkeep Change-Id: I9c2865058480cffb3a4613f25e2eca1f7e5578c0
* include: define _DEFAULT_SOURCEDavid du Colombier2016-11-202-0/+2
| | | | | | | | | | | Since glibc 2.20, the _BSD_SOURCE and _SVID_SOURCE macros are deprecated in favor of the _DEFAULT_SOURCE macro. See https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes Change-Id: I18dd6a698f3f5aa51d1e45bf53b031bb061e17e8 Reviewed-on: https://plan9port-review.googlesource.com/1500 Reviewed-by: David du Colombier <0intro@gmail.com>
* silence more warningsRuss Cox2012-10-212-3/+6
| | | | | R=rsc http://codereview.appspot.com/6744056
* troff: avoid crash if home == NULLRuss Cox2009-12-271-1/+2
| | | | | R=rsc http://codereview.appspot.com/181070
* convert to 4-byte UTF-8 and 32-bit RuneRuss Cox2009-09-111-2/+2
| | | | http://codereview.appspot.com/116075
* INSTALL: fix build on Snow LeopardRuss Cox2009-09-111-0/+2
| | | | http://codereview.appspot.com/116073
* cmd: getline now a dirty word (James Toy)Russ Cox2009-05-311-0/+2
|
* troff: silence gcc printf warningRuss Cox2008-11-172-2/+2
|
* misc: array bounds fixes that gcc finds (John Gosset)Russ Cox2008-05-101-1/+1
|
* fix random troff crash (Noel Hunt)rsc2007-05-081-2/+6
|
* Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.rsc2006-04-017-11/+13
|
* bigger stacksizersc2005-12-291-1/+1
|
* don't need this after all. yay.rsc2005-12-143-19/+6
|
* update request countrsc2005-12-141-1/+1
|
* add .ei for else-ifrsc2005-12-143-6/+19
|
* isdigit (Tom Miller)rsc2005-11-011-1/+1
|
* ctype sign fixes (Tom Miller)rsc2005-10-311-1/+2
|
* ctype sign fixes (Tom Miller)rsc2005-10-313-5/+8
|
* Goodbye SHORTLIBrsc2005-01-041-1/+0
|
* stupid port bug. cannot use %ld to print a long as a *CHARACTER*rsc2004-11-031-1/+1
|
* This should never have been committed in the first place.wkj2004-06-031-136/+0
|
* Tweak to make troff compile silently.wkj2004-05-178-17/+13
|
* Supress line noise.wkj2004-05-161-0/+1
|
* Checkpoint -- still merging with Taj's version of the world.wkj2004-05-1618-56/+86
|
* Let's try this. It's BUGGERED.rsc2004-05-1529-0/+12817