bugGNU roff - Bugs: bug #55806, [PATCH] tmac/doc-ditroff-u: Remove...

 
 

bug #55806: [PATCH] tmac/doc-ditroff-u: Remove spaces in an aritmetic expression

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sat 02 Mar 2019 02:18:10 AM UTC
   
 
Category:  Macro mdoc Severity:  2 - Minor
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  schwarze
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 05 Feb 2023 07:02:36 AM UTC, comment #2: 


commit 9f7a8d91c2dce2c3c5b676b55299dde8aa4f74e2
Author: Ingo Schwarze <schwarze@openbsd.org>
Date:   Sun Mar 3 17:17:50 2019 +0100

    Fix the definition of the string \*[doc-Tn-font-size].

    It must not contain space characters inside escape sequence arguments
    because it may get used in macro arguments, causing the escape sequences
    to get split into multiple arguments.

    Minor bug reported by Bjarni Ingi Gislason
    in https://savannah.gnu.org/bugs/?55806 .


G. Branden Robinson <gbranden>
Group administrator
Sun 03 Mar 2019 04:26:29 PM UTC, comment #1: 

Fixed in commit 9f7a8d91c2dce2c3c5b676b55299dde8aa4f74e2.

I refrained from creating a ChangeLog entry because this seemed too minor.

Ingo Schwarze <schwarze>
Group Member
Sat 02 Mar 2019 02:18:10 AM UTC, original submission:  


From df313f748a22a72d88eeaff548760d72f56fb8f6 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Sat, 2 Mar 2019 02:09:39 +0000
Subject: [PATCH] tmac/doc-ditroff-u: Remove spaces in an aritmetic expression

  Spaces in the string

.ds doc-Tn-font-size \s[(\n[.ps]u - 1z)]

  cause trouble in the unquoted argument \*(Px in

.It \e*(Px   Ta \*(Px       Ta POSIX standard name

  defined as

.ds Px \*[doc-Tn-font-size]\%POSIX

  in the file "tmac/doc-syms-u".

  Output from "groff -ww -mandoc mandoc_char.7 > /dev/null" where
"mandoc_char.7" is from the "mandoc" (Debian
"[mdocml_1.14.4.orig.tar.gz]") package:

  (Line 741 shows the effect of the spaces in the string.)

troff: mandoc_char.7:402: warning: can't find special character 'vA'
troff: mandoc_char.7:428: warning: can't find special character '-+'
troff: mandoc_char.7:471: warning: can't find special character 'coproduct'
troff: mandoc_char.7:606: warning: can't find special character '.j'
troff: mandoc_char.7:688: warning: can't find special character '+e'
troff: mandoc_char.7:726: warning: macro 'R' not defined
troff: mandoc_char.7:727: warning: macro 'Tm' not defined
troff: mandoc_char.7:733: warning: macro 'lq' not defined
troff: mandoc_char.7:734: warning: macro 'rq' not defined
troff: mandoc_char.7:736: warning: macro 'va' not defined
troff: mandoc_char.7:741: warning: missing ')' (got '"')
troff: mandoc_char.7:741: missing ']'
troff: mandoc_char.7:741: warning: missing closing delimiter
troff: mandoc_char.7:741: warning: missing ')' (got '"')
troff: mandoc_char.7:741: missing ']'
troff: mandoc_char.7:741: warning: missing closing delimiter
troff: mandoc_char.7:741: warning: missing ')' (got '')
troff: mandoc_char.7:741: missing ']'
troff: mandoc_char.7:741: warning: missing ')' (got '.')
troff: mandoc_char.7:741: missing ']'
troff: mandoc_char.7:741: warning: number register 'doc-punct\s[(10000u' not defined
troff: mandoc_char.7:741: warning: missing closing delimiter
troff: mandoc_char.7:741: warning: missing ')' (got newline)
troff: mandoc_char.7:741: warning: unbalanced .el request
troff: mandoc_char.7:741: warning: missing ')' (got '\&')
troff: mandoc_char.7:741: missing ']'
troff: mandoc_char.7:742: warning: missing ')' (got '"')
troff: mandoc_char.7:742: missing ']'
troff: mandoc_char.7:742: warning: missing closing delimiter
troff: mandoc_char.7:742: warning: missing ')' (got '"')
troff: mandoc_char.7:742: missing ']'
troff: mandoc_char.7:742: warning: missing closing delimiter
troff: mandoc_char.7:742: warning: missing ')' (got '')
troff: mandoc_char.7:742: missing ']'
troff: mandoc_char.7:742: warning: missing ')' (got '.')
troff: mandoc_char.7:742: missing ']'
troff: mandoc_char.7:742: warning: missing closing delimiter
troff: mandoc_char.7:742: warning: missing ')' (got newline)
troff: mandoc_char.7:742: warning: unbalanced .el request
troff: mandoc_char.7:742: warning: missing ')' (got '\&')
troff: mandoc_char.7:742: missing ']'


Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 tmac/doc-ditroff-u | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tmac/doc-ditroff-u b/tmac/doc-ditroff-u
index 18aa5db8..a75f1d59 100644
--- a/tmac/doc-ditroff-u
+++ b/tmac/doc-ditroff-u
@@ -92,7 +92,9 @@
 .ds doc-Sx-font \f[B]\s[\n[.ps]u]
 .ds doc-Tn-font-shape \f[R]
 \# XXX: adapt to discrete LaTeX font sizes
-.ds doc-Tn-font-size \s[(\n[.ps]u - 1z)]
+\# Use no spaces in the arithmetic expression as the string could be
+\# (is) used in an argument, that is not quoted
+.ds doc-Tn-font-size \s[(\n[.ps]u-1z)]
 .ds doc-Va-font \f[I]\s[\n[.ps]u]
 .ds doc-Xr-font \f[C]\s[\n[.ps]u]
 .
--
2.20.1


Bjarni Ingi Gislason <bjarniig>

 

(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 gbranden (Posted a comment)
  • -email is unavailable- added by schwarze (Posted a comment)
  • -email is unavailable- added by bjarniig (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-03 schwarze Severity3 - Normal 2 - Minor
        StatusNone Fixed
        Assigned toNone schwarze
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code