[TUHS] non-Posix input files

Douglas McIlroy douglas.mcilroy at dartmouth.edu
Fri Mar 28 03:35:16 AEST 2025


>> info groff gives semantics for including nonempty files that don't end
>> with newline. Such files violate the Posix definition of text file.
>>
>> Although groff is certainly justified in providing semantics for
>> non-Posix text, I suggest that it should warn when it does so.

> That's true but I'm hesitant to put groff in the business of wagging its
> finger at users feeding it non-strictly-conforming text files when doing
> so doesn't cause it any problems.

Causing groff problems is an odd criterion. The fact that groff will paste
files together unless the first happens to end in a newline is a sign of
groff 's internals, not of the underlying problem.

A newline missing at the end of a file is typically a symptom of either the
incaution of some other program (perhaps an editor) or of a file having
been unexpectedly truncated (as by a program abort). The latter cause
is common enough to justify warning always, not just about cases that
are inconvenient to groff.

Groff is what it is, but if the treatment of absent final newlines were up
for grabs, I'd argue for the more common solution: in all cases insert
a newline and warn.

Doug


More information about the TUHS mailing list