bug-groff
[Top][All Lists]
Advanced

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

[bug #60673] adjustment algorithm should disregard nonadjusted lines in


From: G. Branden Robinson
Subject: [bug #60673] adjustment algorithm should disregard nonadjusted lines in its alternation pattern
Date: Sat, 4 Sep 2021 08:43:22 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #4, bug #60673 (project groff):

Heads up.

It looks like my planned changes to address #60189 are going to affect this.

You may want to play around with this.


diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 4af8741e1..5e7017b8f 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2053,6 +2053,10 @@ static node *node_list_reverse(node *n)
 static void distribute_space(node *n, int nspaces, hunits desired_space,
                             int force_reverse = 0)
 {
+  if (desired_space.is_zero() || nspaces == 0) {
+    debug("distribute_space(): no work to do");
+    return;
+  }
   static int reverse = 0;
   if (force_reverse || reverse)
     n = node_list_reverse(n);
@@ -2070,7 +2074,6 @@ static void distribute_space(node *n, int nspaces,
hunits desired_space,
     (void)node_list_reverse(n);
   if (!force_reverse)
     reverse = !reverse;
-  assert(desired_space.is_zero() && nspaces == 0);
 }
 
 void environment::possibly_break_line(int start_here, int forced)


(The debug() diagnostic will not survive into the push.  It shows up a LOT in
our in-tree document corpus.)

I haven't thought deeply enough to be sure, but the above change might
actually resolve this bug.  What do you think?

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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