properly handle comments when looking for final ; of a line
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Jun 2009 20:07:30 +0000 (20:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Jun 2009 20:07:30 +0000 (20:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9035 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c

diff --git a/cmd.c b/cmd.c
index b6fab2d..391b0c7 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -321,7 +321,7 @@ void Cbuf_Execute (void)
                                }
                                else
                                {
-                                       if(text[i] == '/' && text[i + 1] == '/')
+                                       if(text[i] == '/' && text[i + 1] == '/' && (i == 0 || ISWHITESPACE(text[i-1])))
                                                comment = true;
                                        if(text[i] == ';')
                                                break;  // don't break if inside a quoted string or comment