Update of bug #68784 (group groff):
Planned Release: None => 1.25.0
Summary: [troff] empty string interpolation given as argument
to `mso` request causes assertion failure since 1.24.0 => [PATCH] [troff]
empty string interpolation given as argument to `mso` request causes assertion
failure since 1.24.0
_______________________________________________________
Follow-up Comment #1:
commit 0046cc889624cc29e62aa809a190333bf535dbde
Author: G. Branden Robinson <[email protected]>
Date: Fri Oct 16 12:57:46 2026 -0500
XXX [troff]: Fix Savannah #68784.
$ echo '.mso \*a' | groff
troff: ../src/libs/libgroff/searchpath.cpp:118: FILE*
search_path::open_file(const char*, char**): Assertion `name != 0' failed.
groff: error: troff: Aborted (core dumped)
$ echo '.msoquiet \*a' | groff
troff: ../src/libs/libgroff/searchpath.cpp:118: FILE*
search_path::open_file(const char*, char**): Assertion `name != 0' failed.
groff: error: troff: Aborted (core dumped)
$ echo '.mso \*a' | ./build/test-groff -ww
troff:<standard input>:1: warning: name 'a' not defined [-w mac]
troff:<standard input>:1: warning: macro file sourcing request expects
argument [-w missing]
$ echo '.msoquiet \*a' | ./build/test-groff -ww
troff:<standard input>:1: warning: name 'a' not defined [-w mac]
troff:<standard input>:1: warning: quiet macro file sourcing request
expects argument [-w missing]
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index af673591e..8ac1bbce9 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -9918,7 +9918,17 @@ static void process_startup_file(const char *filename)
static void do_macro_source(bool quietly)
{
+ const char *rd = 0 /* nullptr */; // request description
+ if (quietly)
+ rd = "quiet macro file sourcing request";
+ else
+ rd = "macro file sourcing request";
char *macro_filename = read_rest_of_line_as_argument();
+ if (0 /* nullptr */ == macro_filename) {
+ error("cannot macro file source a file with an empty name");
+ tok.next();
+ return;
+ }
char *path;
FILE *fp = mac_path->open_file(macro_filename, &path);
if (fp != 0 /* nullptr */) {
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68784>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
