r4627 - trunk/varnish-cache/lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Thu Mar 18 09:15:51 CET 2010


Author: phk
Date: 2010-03-18 09:15:51 +0100 (Thu, 18 Mar 2010)
New Revision: 4627

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_token.c
Log:
Make it an error for a /*...*/ comment to contain /*

Fixes #655



Modified: trunk/varnish-cache/lib/libvcl/vcc_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_token.c	2010-03-17 09:38:47 UTC (rev 4626)
+++ trunk/varnish-cache/lib/libvcl/vcc_token.c	2010-03-18 08:15:51 UTC (rev 4627)
@@ -355,6 +355,15 @@
 		/* Skip C-style comments */
 		if (*p == '/' && p[1] == '*') {
 			for (q = p + 2; q < sp->e; q++) {
+				if (*q == '/' && q[1] == '*') {
+					vsb_printf(tl->sb,
+					    "/* ... */ comment contains /*\n");
+					vcc_AddToken(tl, EOI, p, p + 2);
+					vcc_ErrWhere(tl, tl->t);
+					vcc_AddToken(tl, EOI, q, q + 2);
+					vcc_ErrWhere(tl, tl->t);
+					return;
+				}
 				if (*q == '*' && q[1] == '/') {
 					p = q + 2;
 					break;




More information about the varnish-commit mailing list