bugGNU roff - Bugs: bug #63151, [troff] no diagnostic if drawing...

 
 

bug #63151: [troff] no diagnostic if drawing escape sequence ends without delimiter

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 04 Oct 2022 05:25:01 AM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 06 Oct 2022 02:58:45 PM UTC, comment #2: 

Curiously, you do get a warning if all warnings are turned on--but it's kind of a nonsensical one.


$ printf '\\D@l 100u 0\n' | groff -ww -Tascii 2>&1 | grep . || echo EMPTY
troff: <standard input>:1: warning: missing number


(That's 1.22.4's stderr.  git HEAD rewords it slightly, but the gist is the same.)

Dave <barx>
Group Member
Thu 06 Oct 2022 01:18:54 PM UTC, comment #1: 


commit 122f288e0b307c7caaac215a8cf18a96587ba6b3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Oct 4 00:27:15 2022 -0500

    [troff]: Fix Savannah #63151.

    * src/roff/troff/input.cpp (read_draw_node): Throw "delim" warning
      diagnostic when a drawing escape sequence ends the line without a
      closing delimiter.

    Fixes <https://savannah.gnu.org/bugs/?63151>.


G. Branden Robinson <gbranden>
Group administrator
Tue 04 Oct 2022 05:25:01 AM UTC, original submission:  

Affects groff 1.22.4.


$ groff --version | head -n 1
GNU groff version 1.22.4
$ printf '\\D@l 100u 0\n' | groff -Tascii 2>&1 | grep . || echo EMPTY
EMPTY


I have a fix in progress.


diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 0005cdaad..3a008b01d 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8590,6 +8592,12 @@ static node *read_draw_node()
          maxpoints *= 2;
          delete[] oldpoint;
        }
+       if (tok.is_newline() || tok.is_eof()) {
+         warning(WARN_DELIM, "missing closing delimiter in drawing"
+                 " escape sequence (got %1)", tok.description());
+         err = true;
+         break;
+       }
        if (!get_hunits(&point[i].h,
                        type == 'f' || type == 't' ? 'u' : 'm')) {
          err = true;


G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-10-06 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code