URL: <https://savannah.gnu.org/bugs/?68719>
Summary: [soelim] .so'ed file without a trailing newline is
handled differently
Group: GNU roff
Submitter: barx
Submitted: Sun 27 Sep 2026 04:35:45 PM CDT
Category: Preprocessor soelim
Severity: 2 - Minor
Item Group: Incorrect behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sun 27 Sep 2026 04:35:45 PM CDT By: Dave <barx>
As the info manual notes about the .so request: "Since the formatter replaces
the entire control line with the contents of a file, FILE must end with a
newline, or the formatter will continue reading the next input line of the
'roff' file as if it were part of the last line of the sourced file." An
example demonstrates this.
However, this behavior changes if the soelim preprocessor is used: soelim
silently adds a final newline to the interpolated file, even in "raw" mode.
Consider this example slightly modified from the one in the manual:
$ printf 'foo' > xxx
$ soelim -r <<EOF
The situation is
.so xxx
bar.
EOF
The situation is
foo
bar.
In 2018, Ralph Corderoy pointed out this difference between how the formatter
treats .so and how soelim does
(http://lists.gnu.org/r/groff/2018-08/msg00038.html). He further observes
that this is a difference between GNU's soelim and Heirloom's, which does not
append the newline. This suggests that GNU soelim behavior might be changed
to match that of Heirloom (and presumably AT&T).
Even if no code is changed, this difference should be documented. Currently
it is not mentioned in the .so section of the info manual, nor in the soelim
man page. I've filed this ticket as "Incorrect behaviour" but it can be
changed to "Documentation" if this option is chosen.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68719>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
