summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2006-09-06 15:27:01 +0000
committerwl <wl>2006-09-06 15:27:01 +0000
commitd24668785067388288a9a1ce61c814bacc54e7f5 (patch)
tree45393efc3dc5bca7437240ff5220d8cce35c321a /src
parentb3cf4f5f630e1f1428d49ec82a543f52a55ee05d (diff)
downloadgroff-d24668785067388288a9a1ce61c814bacc54e7f5.tar.gz
* src/roff/troff/env.cpp (environment::do_break): Insert zero-width
space only if there is no previous space. This fixes a bug which caused unwanted filling of the last line in a paragraph. Thanks to Gunnar Ritter for an analysis.
Diffstat (limited to 'src')
-rw-r--r--src/roff/troff/env.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 25bde8a1..0f907be8 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2336,8 +2336,10 @@ void environment::do_break(int do_spread)
wrap_up_tab();
if (line) {
// this is so that hyphenation works
- line = new space_node(H0, get_fill_color(), line);
- space_total++;
+ if (line->nspaces() == 0) {
+ line = new space_node(H0, get_fill_color(), line);
+ space_total++;
+ }
possibly_break_line(0, do_spread);
}
while (line != 0 && line->discardable()) {