groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 21/80: [groff]: Throw `getopt_long()` a bone when -Thtml.


From: G. Branden Robinson
Subject: [groff] 21/80: [groff]: Throw `getopt_long()` a bone when -Thtml.
Date: Sat, 30 Nov 2024 04:02:15 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit d6e54c9c6a80545372b4c19e2987dc40b4ca7aae
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Nov 27 05:25:18 2024 -0600

    [groff]: Throw `getopt_long()` a bone when -Thtml.
    
    * src/roff/groff/groff.cpp (main): When constructing `pre-grohtml`
      command line, inject `--` argument before `troff` command to help
      `getopt_long()` identify the end of `pre-grohtml` options,
      particularly in cases where the argument sequence is malformed
      (options that take arguments not getting them, for example).
    
    Fixes <https://savannah.gnu.org/bugs/?66485>.
---
 ChangeLog                | 11 +++++++++++
 src/roff/groff/groff.cpp |  1 +
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 49223db57..ac1c13a43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/groff/groff.cpp (main): When constructing
+       `pre-grohtml` command line, inject `--` argument before `troff`
+       command to help `getopt_long()` identify the end of
+       `pre-grohtml` options, particularly in cases where the argument
+       sequence is malformed (options that take arguments not getting
+       them, for example).
+
+       Fixes <https://savannah.gnu.org/bugs/?66485>.
+
 2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/html/pre-html.cpp (do_file): Nullify
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 80a2cd06c..4470f06f9 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -393,6 +393,7 @@ int main(int argc, char **argv)
                             " 'postpro' directive");
   if (predriver && !zflag) {
     commands[TROFF_INDEX].insert_arg(commands[TROFF_INDEX].get_name());
+    commands[TROFF_INDEX].insert_arg("--");
     commands[TROFF_INDEX].set_name(predriver);
     // pass the device arguments to the predrivers as well
     commands[TROFF_INDEX].insert_args(Pargs);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]