Update of bug #68868 (group groff):

                  Status:                    None => In Progress
             Assigned to:                    None => gbranden
                 Summary: [troff] `ne` request should not perform operation if
argument invalid => [PATCH] [troff] `ne` request should not perform operation
if argument invalid

    _______________________________________________________

Follow-up Comment #1:

Easily done, but not targeting at _groff_ 1.25.


commit 28e27387db98407c55f9ae775ea193f46b64d70d
Author: G. Branden Robinson <[email protected]>
Date:   Sat Oct 31 21:34:36 2026 -0500

    XXX [troff]: Fix Savannah #68868. `ne` request

diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index ce89cc876..ba3cdeea3 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -115,6 +115,7 @@ groff_TESTS = \
   src/roff/groff/tests/error-glyph-rule-escape-given-non-character.sh \
   src/roff/groff/tests/error-grief-token-descriptions.sh \
   src/roff/groff/tests/error-mso-request-given-empty-argument.sh \
+  src/roff/groff/tests/error-ne-request-given-bogus-argument.sh \
   src/roff/groff/tests/error-no-space-between-dt-or-wh-arguments.sh \
   src/roff/groff/tests/error-overflow-symbol-table.sh \
   src/roff/groff/tests/error-pcolor-request-given-bogus-argument.sh \
diff --git a/src/roff/groff/tests/error-ne-request-given-bogus-argument.sh
b/src/roff/groff/tests/error-ne-request-given-bogus-argument.sh
new file mode 100755
index 000000000..588fdf5d9
--- /dev/null
+++ b/src/roff/groff/tests/error-ne-request-given-bogus-argument.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+output=$(printf '.ne FOOBAR\n' | "$groff" -T ascii)
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 6cb498448..baa360fbc 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -921,8 +921,13 @@ BEGIN_TRAP token is not skipped over. */
 
 static void need_vertical_space_request() // .ne
 {
-  vunits n;
-  if (!has_arg() || !read_vunits(&n, 'v'))
+  vunits n = V0;
+  if (has_arg())
+    if (!read_vunits(&n, 'v')) {
+      skip_line();
+      return;
+    }
+  else
     n = curenv->get_vertical_spacing();
   while (!tok.is_terminator())
     tok.next();




    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to