From: havoc Date: Fri, 5 Mar 2004 02:11:22 +0000 (+0000) Subject: improve console text parsing a little (now handles \r line endings as well as \n... X-Git-Tag: xonotic-v0.1.0preview~6034 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=f58d94957b6413228170173c555521e5c7b160cd improve console text parsing a little (now handles \r line endings as well as \n, and strips whitespace before the line, just for completeness) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3971 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cmd.c b/cmd.c index 47a46928..79168528 100644 --- a/cmd.c +++ b/cmd.c @@ -158,13 +158,15 @@ void Cbuf_Execute (void) text = (char *)cmd_text.data; quotes = 0; + while (*text && *text <= ' ') + text++; for (i=0 ; i< cmd_text.cursize ; i++) { if (text[i] == '"') quotes++; if ( !(quotes&1) && text[i] == ';') break; // don't break if inside a quoted string - if (text[i] == '\n') + if (text[i] == '\r' || text[i] == '\n') break; }