constants inside brackets. (Bug#10357)
+2011-12-25 Andreas Schwab <schwab@linux-m68k.org>
+
+ * etags.c (C_entries): Properly skip over string and character
+ constants and comments inside brackets. (Bug#10357)
+
2011-12-04 Juanma Barranquero <lekktu@gmail.com>
* emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0;
}
continue;
}
- else if (bracketlev > 0)
- {
- switch (c)
- {
- case ']':
- if (--bracketlev > 0)
- continue;
- break;
- case '\0':
- CNL_SAVE_DEFINEDEF ();
- break;
- }
- continue;
- }
else switch (c)
{
case '"':
inquote = TRUE;
+ if (bracketlev > 0)
+ continue;
if (inattribute)
break;
switch (fvdef)
continue;
case '\'':
inchar = TRUE;
+ if (bracketlev > 0)
+ continue;
if (inattribute)
break;
- if (fvdef != finlist && fvdef != fignore && fvdef !=vignore)
+ if (fvdef != finlist && fvdef != fignore && fvdef != vignore)
{
fvextern = FALSE;
fvdef = fvnone;
incomm = TRUE;
lp++;
c = ' ';
+ if (bracketlev > 0)
+ continue;
}
else if (/* cplpl && */ *lp == '/')
{
for (cp = newlb.buffer; cp < lp-1; cp++)
if (!iswhite (*cp))
{
- if (*cp == '*' && *(cp+1) == '/')
+ if (*cp == '*' && cp[1] == '/')
{
cp++;
cpptoken = TRUE;
continue;
case '[':
bracketlev++;
- continue;
+ continue;
+ default:
+ if (bracketlev > 0)
+ {
+ if (c == ']')
+ --bracketlev;
+ else if (c == '\0')
+ CNL_SAVE_DEFINEDEF ();
+ continue;
+ }
+ break;
} /* switch (c) */