diff --git a/quakespasm/Quake/console.c b/quakespasm/Quake/console.c index f9873a42..28ae555a 100644 --- a/quakespasm/Quake/console.c +++ b/quakespasm/Quake/console.c @@ -402,6 +402,7 @@ void Con_Print (const char *txt) int c, l; static int cr; int mask; + qboolean boundary; //con_backscroll = 0; //johnfitz -- better console scrolling @@ -420,17 +421,27 @@ void Con_Print (const char *txt) else mask = 0; + boundary = true; while ( (c = *txt) ) { - // count word length - for (l=0 ; l< con_linewidth ; l++) - if ( txt[l] <= ' ') - break; + if (c <= ' ') + { + boundary = true; + } + else if (boundary) + { + // count word length + for (l = 0; l < con_linewidth; l++) + if (txt[l] <= ' ') + break; - // word wrap - if (l != con_linewidth && (con_x + l > con_linewidth) ) - con_x = 0; + // word wrap + if (l != con_linewidth && (con_x + l > con_linewidth)) + con_x = 0; + + boundary = false; + } txt++;