improve console text parsing a little (now handles \r line endings as well as \n...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 5 Mar 2004 02:11:22 +0000 (02:11 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 5 Mar 2004 02:11:22 +0000 (02:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3971 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c

diff --git a/cmd.c b/cmd.c
index 47a4692..7916852 100644 (file)
--- 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;
                }