diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-12-04 19:39:31 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-12-04 19:39:31 +0100 |
commit | 1ae6f8081b1e82f4dbb956156a5a0e09681bccfa (patch) | |
tree | f10b4b3ea41e201216f844d9c521c9b7f08337eb /src | |
parent | 4cf20df5887500aa59d413445d37b16e97a6e4fb (diff) |
add dummy word for empty lines in plain.cc
Diffstat (limited to 'src')
-rw-r--r-- | src/plain.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plain.cc b/src/plain.cc index 394c4ca5..4da618e4 100644 --- a/src/plain.cc +++ b/src/plain.cc @@ -139,10 +139,15 @@ void DilloPlain::addLine(char *Buf, uint_t BufSize) char buf[128]; char *end = Buf + BufSize; - // Limit word len to avoid X11 coordinate - // overflow with extremely long lines. - while ((len = a_Misc_expand_tabs(&Buf, end, buf, sizeof(buf)))) - DW2TB(dw)->addText(buf, len, widgetStyle); + if (BufSize > 0) { + // Limit word length to avoid X11 coordinate + // overflow with extremely long lines. + while ((len = a_Misc_expand_tabs(&Buf, end, buf, sizeof(buf)))) + DW2TB(dw)->addText(buf, len, widgetStyle); + } else { + // Add dummy word for empty lines - otherwise the parbreak is ignored. + DW2TB(dw)->addText("", 0, widgetStyle); + } DW2TB(dw)->addParbreak(0, widgetStyle); } |