X11 messageboxes should treat "\r\n" as "\n" by ignoring the '\r' char.

--HG--
extra : rebase_source : 0054e96755f753555237f3d7dd64f1dfa1a1e56c
This commit is contained in:
Ryan C. Gordon 2012-12-16 14:39:49 -05:00
parent adefd543ce
commit c2ec53f4fa
2 changed files with 23 additions and 0 deletions

View file

@ -250,6 +250,10 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data )
data->text_height = IntMax( data->text_height, height );
text_width_max = IntMax( text_width_max, plinedata->width );
if (lf && (lf > text) && (lf[-1] == '\r')) {
plinedata->length--;
}
text += plinedata->length + 1;
/* Break if there are no more linefeeds. */