bug-groff
[Top][All Lists]
Advanced

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

[bug #57873] grog mangles output


From: Bjarni Ingi Gislason
Subject: [bug #57873] grog mangles output
Date: Sat, 5 Dec 2020 19:33:22 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #1, bug #57873 (project groff):

Subject: [PATCH] grog/subs.pl: Fix wrong regexp for groff options

groff/src/roff/grog/subs.pl: Fix wrong regular expressions for groff
options

  The arguments to an option can contain other characters than
alphanumeric and '_', like '=' and '.'.

  The options' arguments in the output shall not start with a
HYPHEN-MINUS (-).

  Original output:

groff -w -w -f -N -T ps -t -man man/groff.7

  After the patch:

groff -w w -f N -P -pa5 -r a5=0 -T ps -t -man man/groff.7

(Actually to be right, "-dpaper=a5" is missing in the command line.)

Fixes bug #57873.


Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 src/roff/grog/subs.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/roff/grog/subs.pl b/src/roff/grog/subs.pl
index 65e55e78..1c40dd95 100644
--- a/src/roff/grog/subs.pl
+++ b/src/roff/grog/subs.pl
@@ -272,14 +272,15 @@ sub handle_args {
       next;
     }
 
-    if ($arg =~ /^-(\w)(\w*)$/) {      # maybe a groff option
+    if ($arg =~ /^-(\w)([^ ]*)$/) {    # maybe a groff option
       my $opt_char = $1;
       my $opt_char_with_arg = $opt_char . ':';
       my $others = $2;
       if ( $groff_opts =~ /$opt_char_with_arg/ ) {     # groff optarg
        if ( $others ) {        # optarg is here
          push @Command, '-' . $opt_char;
-         push @Command, '-' . $others;
+#        push @Command, '-' . $others;
+         push @Command, '' . $others;
          next;
        }
        # next arg is optarg
-- 
2.29.2



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57873>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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