]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cmd.c
properly handle comments when looking for final ; of a line
[xonotic/darkplaces.git] / 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