Commit 28796b3a authored by Andreas Schwab's avatar Andreas Schwab
Browse files

* etags.c (C_entries): Properly skip over string and character

constants inside brackets.  (Bug#10357)
parent ca22b785
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;
......
......@@ -3189,24 +3189,12 @@ C_entries (int c_ext, FILE *inf)
}
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)
......@@ -3224,9 +3212,11 @@ C_entries (int c_ext, FILE *inf)
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;
......@@ -3238,6 +3228,8 @@ C_entries (int c_ext, FILE *inf)
incomm = TRUE;
lp++;
c = ' ';
if (bracketlev > 0)
continue;
}
else if (/* cplpl && */ *lp == '/')
{
......@@ -3270,7 +3262,7 @@ C_entries (int c_ext, FILE *inf)
for (cp = newlb.buffer; cp < lp-1; cp++)
if (!iswhite (*cp))
{
if (*cp == '*' && *(cp+1) == '/')
if (*cp == '*' && cp[1] == '/')
{
cp++;
cpptoken = TRUE;
......@@ -3284,7 +3276,17 @@ C_entries (int c_ext, FILE *inf)
continue;
case '[':
bracketlev++;
continue;
continue;
default:
if (bracketlev > 0)
{
if (c == ']')
--bracketlev;
else if (c == '\0')
CNL_SAVE_DEFINEDEF ();
continue;
}
break;
} /* switch (c) */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment