When checking for literal strings to ignore, consider also unicode, binary and raw strings.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5821 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
fdc80371c8
commit
2d95161b05
@ -1,3 +1,10 @@
|
||||
2011-05-29 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
|
||||
* tagmanager/python.c:
|
||||
When checking for literal strings to ignore, consider also
|
||||
unicode, binary and raw strings.
|
||||
|
||||
|
||||
2011-05-27 Colomban Wendling <colomban(at)geany(dot)org>
|
||||
|
||||
* src/prefs.c:
|
||||
|
@ -195,9 +195,30 @@ static const char *skipString (const char *cp)
|
||||
/* Skip everything up to an identifier start. */
|
||||
static const char *skipEverything (const char *cp)
|
||||
{
|
||||
int match;
|
||||
for (; *cp; cp++)
|
||||
{
|
||||
match = 0;
|
||||
if (*cp == '"' || *cp == '\'' || *cp == '#')
|
||||
match = 1;
|
||||
|
||||
/* these checks find unicode, binary (Python 3) and raw strings */
|
||||
if (!match && (
|
||||
!strncasecmp(cp, "u'", 2) || !strncasecmp(cp, "u\"", 2) ||
|
||||
!strncasecmp(cp, "r'", 2) || !strncasecmp(cp, "r\"", 2) ||
|
||||
!strncasecmp(cp, "b'", 2) || !strncasecmp(cp, "b\"", 2)))
|
||||
{
|
||||
match = 1;
|
||||
cp += 1;
|
||||
}
|
||||
if (!match && (
|
||||
!strncasecmp(cp, "ur'", 3) || !strncasecmp(cp, "ur\"", 3) ||
|
||||
!strncasecmp(cp, "br'", 3) || !strncasecmp(cp, "br\"", 3)))
|
||||
{
|
||||
match = 1;
|
||||
cp += 2;
|
||||
}
|
||||
if (match)
|
||||
{
|
||||
cp = skipString(cp);
|
||||
if (!*cp) break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user