summaryrefslogtreecommitdiff
path: root/src/roff/troff
diff options
context:
space:
mode:
authorwl <wl>2005-01-19 06:50:30 +0000
committerwl <wl>2005-01-19 06:50:30 +0000
commit9ee338637e5940c1e3db0462137b6d7f0dedcadb (patch)
treeacf89a29b808b1d2ba752338e605bbd743783be9 /src/roff/troff
parentd2d50c8448bc8bfb814ee1181f714fe23c3cff37 (diff)
downloadgroff-9ee338637e5940c1e3db0462137b6d7f0dedcadb.tar.gz
* tmac/doc-common (Dd), tmac/doc-ditroff (gX, doc-setup-header):
Remove dead code. * src/roff/troff/div.cpp (top_level_diversion::space): Protect against division by zero.
Diffstat (limited to 'src/roff/troff')
-rw-r--r--src/roff/troff/div.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 7ad7e4ca..f372239c 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -459,8 +459,9 @@ void top_level_diversion::space(vunits n, int forced)
vunits next_trap_pos;
trap *next_trap = find_next_trap(&next_trap_pos);
vunits y = vertical_position + n;
- curenv->seen_space += n.to_units()
- / curenv->get_vertical_spacing().to_units();
+ if (curenv->get_vertical_spacing().to_units())
+ curenv->seen_space += n.to_units()
+ / curenv->get_vertical_spacing().to_units();
if (vertical_position_traps_flag && next_trap != 0 && y >= next_trap_pos) {
vertical_position = next_trap_pos;
nl_reg_contents = vertical_position.to_units();