gbranden pushed a commit to branch master
in repository groff.
commit 477c0fcd76b074898aa0aa7df2f4fad6976d1753
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 2 21:51:19 2026 -0600
[soelim]: Fix Savannah #68719 (2/2).
* src/preproc/soelim/soelim.cpp (do_file): Throw warning if an input or
included file lacks a final newline.
Fixes <https://savannah.gnu.org/bugs/?68719>. Thanks to Ralph Corderoy
for the 2018 report to the mailing list and Dave Kemper for bringing it
to renewed attention.
---
ChangeLog | 9 +++++++++
src/preproc/soelim/soelim.cpp | 7 +++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0cf109d02..1fb59cad3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2026-11-02 G. Branden Robinson <[email protected]>
+
+ * src/preproc/soelim/soelim.cpp (do_file): Throw warning if an
+ input or included file lacks a final newline.
+
+ Fixes <https://savannah.gnu.org/bugs/?68719>. Thanks to Ralph
+ Corderoy for the 2018 report to the mailing list and Dave Kemper
+ for bringing it to renewed attention.
+
2026-11-02 G. Branden Robinson <[email protected]>
* src/preproc/soelim/soelim.cpp (do_file): In raw mode, don't
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 63f97fa9a..6ca8cc3c2 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -372,8 +372,11 @@ static bool do_file(const char *filename)
default:
assert(0 == "unhandled state in file parser at EOF");
}
- if (!want_raw_output && !file_ends_with_newline)
- putc('\n', stdout);
+ if (!file_ends_with_newline) {
+ warning("end of file lacks a newline");
+ if (!want_raw_output)
+ putc('\n', stdout);
+ }
if (fp != stdin)
if (fclose(fp) < 0)
fatal("cannot close '%1': %2", whole_filename.contents(),
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit