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:
Enrico Tröger 2011-05-29 17:40:50 +00:00
parent fdc80371c8
commit 2d95161b05
2 changed files with 28 additions and 0 deletions

View File

@ -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:

View File

@ -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;