1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

justify_line(): Re-add wordlen == 0 test

This fixes ELinks crashing on this with terminal width e.g. 103:

	<p align="justify">
	xxxx xxxx xxxx xxxxx xxxxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx
	xxxxx xxxx xxxxxxx xxx xxxxxxx xxx xxxx xxxx xxxx xx xxxx x xxx xxxx
	xxxx xx xxxx xxxx xxxx xxx&mdash;xxx xxxx xx&mdash;xxx xxxx<em> </em>x
	xxxx </p>

This test was removed for an unknown reason in commit
b1cc717789.

Discovered together with Miciah.
This commit is contained in:
Petr Baudis 2007-08-26 19:06:26 +02:00 committed by Petr Baudis
parent 1fd2a77416
commit 18cdce6c39

View File

@ -1128,6 +1128,7 @@ justify_line(struct html_context *html_context, int y)
assert(word_len >= 0);
if_assert_failed continue;
if (!word_len) continue;
word_shift = (word * diff) / (spaces - 1);
new_start = word_start + word_shift;