<feed xmlns='http://www.w3.org/2005/Atom'>
<title>plan9port/src/cmd/troff, branch patch</title>
<subtitle>Plan 9 from User Space (with patches)</subtitle>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/'/>
<entry>
<title>troff: fix SIGFPE when using modulus operator</title>
<updated>2025-11-09T19:25:48+00:00</updated>
<author>
<name>G. Branden Robinson</name>
<email>g.branden.robinson@gmail.com</email>
</author>
<published>2025-11-09T12:38:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=f39a2407b6e6ace6af68e466bfa2f362b9a9dd36'/>
<id>f39a2407b6e6ace6af68e466bfa2f362b9a9dd36</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>nroff: bad symbold definition on command line.</title>
<updated>2025-10-10T18:34:02+00:00</updated>
<author>
<name>Dan Cross</name>
<email>cross@gajendra.net</email>
</author>
<published>2025-10-10T18:33:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=499efb270d7d5e841b51fc1a44400da54ba58361'/>
<id>499efb270d7d5e841b51fc1a44400da54ba58361</id>
<content type='text'>
`-DTDEVNAME=...` should be `-DNDEVNAME=...`.  We've been
defaulting for "37", probably forever.

Signed-off-by: Dan Cross &lt;cross@gajendra.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`-DTDEVNAME=...` should be `-DNDEVNAME=...`.  We've been
defaulting for "37", probably forever.

Signed-off-by: Dan Cross &lt;cross@gajendra.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>warnings: fix warnings on newer compilers</title>
<updated>2025-07-24T15:45:31+00:00</updated>
<author>
<name>Dan Cross</name>
<email>cross@gajendra.net</email>
</author>
<published>2025-07-24T14:22:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=4089e29e89026f0b581155987d5f683d7635fd13'/>
<id>4089e29e89026f0b581155987d5f683d7635fd13</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>troff: support `\~` as an alias for `\ ` (#567)</title>
<updated>2022-08-13T03:37:28+00:00</updated>
<author>
<name>g-branden-robinson</name>
<email>91402745+g-branden-robinson@users.noreply.github.com</email>
</author>
<published>2022-08-13T03:37:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=93f814360076ccf28d33c9cb909fca7200ba4a7d'/>
<id>93f814360076ccf28d33c9cb909fca7200ba4a7d</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>all: fix or silence various gcc warnings</title>
<updated>2020-01-12T20:07:42+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2020-01-12T20:05:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=fafa622a5bdf71adfbb4334541c3b65f29c89ca9'/>
<id>fafa622a5bdf71adfbb4334541c3b65f29c89ca9</id>
<content type='text'>
As usual, gcc finds some real problems but also reports a ton
of noise. Fix the problems and quiet the noise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As usual, gcc finds some real problems but also reports a ton
of noise. Fix the problems and quiet the noise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Trivial changes: whitespace and modes.</title>
<updated>2020-01-10T14:54:30+00:00</updated>
<author>
<name>Dan Cross</name>
<email>cross@gajendra.net</email>
</author>
<published>2020-01-10T14:44:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=fa325e9b42b0bdfb48857d1958d9fb7ceac55151'/>
<id>fa325e9b42b0bdfb48857d1958d9fb7ceac55151</id>
<content type='text'>
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 &lt;cross@gajendra.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;cross@gajendra.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: remove .cvsignore files</title>
<updated>2017-09-14T15:25:17+00:00</updated>
<author>
<name>Kare Nuorteva</name>
<email>kare.nuorteva@me.com</email>
</author>
<published>2017-09-10T10:26:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=b3336e5cbb82042dfeedab8615022410b74f8520'/>
<id>b3336e5cbb82042dfeedab8615022410b74f8520</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>include: define _DEFAULT_SOURCE</title>
<updated>2016-11-20T09:37:58+00:00</updated>
<author>
<name>David du Colombier</name>
<email>0intro@gmail.com</email>
</author>
<published>2016-05-07T15:36:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=657f699ef7e5a91a529337cac76ed48c68a28583'/>
<id>657f699ef7e5a91a529337cac76ed48c68a28583</id>
<content type='text'>
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 &lt;0intro@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;0intro@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>silence more warnings</title>
<updated>2012-10-21T16:04:56+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2012-10-21T16:04:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=c5bfba483f4002c539cbeb4087827524dba8d0f8'/>
<id>c5bfba483f4002c539cbeb4087827524dba8d0f8</id>
<content type='text'>
R=rsc
http://codereview.appspot.com/6744056
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
R=rsc
http://codereview.appspot.com/6744056
</pre>
</div>
</content>
</entry>
<entry>
<title>troff: avoid crash if home == NULL</title>
<updated>2009-12-27T17:22:43+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2009-12-27T17:22:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=6530d37d7f3f6d00527a71ba8a02c536c28b5d9f'/>
<id>6530d37d7f3f6d00527a71ba8a02c536c28b5d9f</id>
<content type='text'>
R=rsc
http://codereview.appspot.com/181070
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
R=rsc
http://codereview.appspot.com/181070
</pre>
</div>
</content>
</entry>
</feed>
