Commit 71a8a74b authored by Robert O'Callahan's avatar Robert O'Callahan Committed by Alexandre Julliard

Fixed bug in TEXT_WordBreak that was variously throwing Lotus Notes

into an infinite loop or causing it to crash.
parent 5769d1de
......@@ -356,13 +356,15 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
/* If there was one or the first character didn't fit then */
if (word_fits)
{
int next_is_space;
/* break the line before/after that character */
if (!(format & (DT_RIGHT | DT_CENTER)) || *p != SPACE)
p++;
next_is_space = (p - str) < *len_str && *p == SPACE;
*len_str = p - str;
/* and if the next character is a space then discard it. */
*chars_used = *len_str;
if (*p == SPACE)
if (next_is_space)
(*chars_used)++;
}
/* Suppose there was none. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment