]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 b6fab2d29c70c5b36a39126f4c6161028a3f5598..391b0c7b0a4eed5cfd4a169536d6f5e8179b2778 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