groff-commit
[Top][All Lists]
Advanced

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

[groff] 12/14: [troff]: Fix Savannah #66038 ("computed" lengths).


From: G. Branden Robinson
Subject: [groff] 12/14: [troff]: Fix Savannah #66038 ("computed" lengths).
Date: Wed, 31 Jul 2024 02:37:21 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 93d264070da6fff3f78c3831032eeba46aeeb2aa
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Jul 30 21:40:44 2024 -0500

    [troff]: Fix Savannah #66038 ("computed" lengths).
    
    * src/roff/troff/div.cpp (page_length):
    * src/roff/troff/env.cpp (line_length, title_length): Tweak diagnostic
      to say "computed" rather than "invalid", because while the value we're
      complaining about _is_ invalid, it is also a numeric expression that
      may have traveled a great distance through the alimentary canal of GNU
      troff's arithmetic evaluator, and bear little resemblance to what the
      user typed in a source document.  Among other things, we no longer
      have any idea what scaling units were supplied, but can report them
      only in basic units.
    
    Fixes <https://savannah.gnu.org/bugs/?66038>.  Thanks to Dave Kemper for
    the report.
---
 ChangeLog              | 16 ++++++++++++++++
 src/roff/troff/div.cpp |  2 +-
 src/roff/troff/env.cpp |  4 ++--
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fec31e24d..20bf4efd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2024-07-30  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/div.cpp (page_length):
+       * src/roff/troff/env.cpp (line_length, title_length): Tweak
+       diagnostic to say "computed" rather than "invalid", because
+       while the value we're complaining about _is_ invalid, it is also
+       a numeric expression that may have traveled a great distance
+       through the alimentary canal of GNU troff's arithmetic
+       evaluator, and bear little resemblance to what the user typed in
+       a source document.  Among other things, we no longer have any
+       idea what scaling units were supplied, but can report them only
+       in basic units.
+
+       Fixes <https://savannah.gnu.org/bugs/?66038>.  Thanks to Dave
+       Kemper for the report.
+
 2024-07-30  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * doc/groff.texi.in (Manipulating Hyphenation): Fix incorrect
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 5b352a315..dc029be0b 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -704,7 +704,7 @@ void page_length()
   vunits temp;
   if (has_arg() && get_vunits(&temp, 'v', topdiv->get_page_length())) {
     if (temp < vresolution) {
-      warning(WARN_RANGE, "setting invalid page length %1u to device"
+      warning(WARN_RANGE, "setting computed page length %1u to device"
                          " vertical motion quantum",
                          temp.to_units());
       temp = vresolution;
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 6c443a3a9..35a81d12c 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1435,7 +1435,7 @@ void line_length()
   hunits temp;
   if (has_arg() && get_hunits(&temp, 'm', curenv->line_length)) {
     if (temp < hresolution) {
-      warning(WARN_RANGE, "setting invalid line length %1u to device"
+      warning(WARN_RANGE, "setting computed line length %1u to device"
                          " horizontal motion quantum",
                          temp.to_units());
       temp = hresolution;
@@ -1454,7 +1454,7 @@ void title_length()
   hunits temp;
   if (has_arg() && get_hunits(&temp, 'm', curenv->title_length)) {
     if (temp < hresolution) {
-      warning(WARN_RANGE, "setting invalid title length %1u to device"
+      warning(WARN_RANGE, "setting computed title length %1u to device"
                          " horizontal motion quantum",
                          temp.to_units());
       temp = hresolution;



reply via email to

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