# HG changeset patch # User truelight # Date 1177756860 0 # Node ID 60b0e082723c754319b035dd51190a2aa8f4301b # Parent 3cd1bd7a6edbafbaddb518da60a6025413e06e70 (svn r9731) -Fix [FS#677]: in news history, newlines weren't replaced with spaces, making it look ugly from time to time diff -r 3cd1bd7a6edb -r 60b0e082723c src/news_gui.cpp --- a/src/news_gui.cpp Fri Apr 27 21:35:02 2007 +0000 +++ b/src/news_gui.cpp Sat Apr 28 10:41:00 2007 +0000 @@ -620,15 +620,21 @@ * from it such as big fonts, etc. */ ptr = buffer; dest = buffer2; + WChar c_last = '\0'; for (;;) { WChar c = Utf8Consume(&ptr); if (c == 0) break; - if (c == '\r') { + /* Make a space from a newline, but ignore multiple newlines */ + if (c == '\n' && c_last != '\n') { + dest[0] = ' '; + dest++; + } else if (c == '\r') { dest[0] = dest[1] = dest[2] = dest[3] = ' '; dest += 4; } else if (IsPrintable(c)) { dest += Utf8Encode(dest, c); } + c_last = c; } *dest = '\0';