18934703 gtroff hangs in environment::possibly_break_line with -mja s11-update
authorosayama <osamu.sayama@oracle.com>
Tue, 24 Mar 2015 17:03:41 -0700
branchs11-update
changeset 4015 3592adaad446
parent 4014 9dbd5dce19df
child 4017 d3dce02237d6
18934703 gtroff hangs in environment::possibly_break_line with -mja
components/groff/patches/gtroff_hang_mja.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/groff/patches/gtroff_hang_mja.patch	Tue Mar 24 17:03:41 2015 -0700
@@ -0,0 +1,15 @@
+This patch comes from in-house and has been submitted upstream:
+http://savannah.gnu.org/bugs/?44018
+
+--- groff-1.22.2/src/roff/troff/env.cpp.org	2013-02-07 21:06:06.000000000 +0900
++++ groff-1.22.2/src/roff/troff/env.cpp	2015-01-14 10:23:07.817142586 +0900
+@@ -2110,6 +2110,9 @@
+     }
+     distribute_space(pre, bp->nspaces, extra_space_width);
+     hunits output_width = bp->width + extra_space_width;
++    if (output_width <= 0)
++      return;
++
+     input_line_start -= output_width;
+     if (bp->hyphenated)
+       hyphen_line_count++;