Hi Doug,

At 2025-03-27T15:50:50-0400, Douglas McIlroy wrote:
> It seems my reply to Clem went astray. POSIX Part 2, Shell and
> Utilities, is very clear:
> 
> 2..2.2.181 text file: A File that contains characters organized into
> one or more lines.
> The lines shall not contain NUL characters ...
> 
> 2.2.2.95 line: A sequence of zero or more non-<newline> characters
> plus a terminating <newline> character,
> 
> Oddly--and in my opinion wrongly--the standard excludes empty files.
> It would be a shock if an editor or groff refused to process an empty
> file and thereby broke Kernighan's law, "Do nothing gracefully".

I think I can claim that GNU troff has long upheld that principle.

$ printf '' | ~/groff-HEAD/bin/groff | grep . || echo NO OUTPUT
NO OUTPUT
$ printf '' | ~/groff-1.23.0/bin/groff | grep . || echo NO OUTPUT
NO OUTPUT
$ printf '' | ~/groff-1.22.4/bin/groff | grep . || echo NO OUTPUT
NO OUTPUT
$ printf '' | ~/groff-1.22.3/bin/groff | grep . || echo NO OUTPUT
NO OUTPUT

That carries us back through over 10 years of groff development.  I'd
bet it's been the case since 1991.  Maybe earlier.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to