Fix wrong parsing of keywords if they are not followed by a space (closes #2037728).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2856 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2008-08-05 08:54:02 +00:00
parent b96999dec9
commit b25c2d6248
2 changed files with 13 additions and 1 deletions

View File

@ -3,6 +3,9 @@
* src/vte.c:
Revert the recent VTE realisation changes as they don't make things
better.
* tagmanager/tcl.c:
Fix wrong parsing of keywords if they are not followed by a space
(closes #2037728).
2008-08-03 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -55,7 +55,16 @@ static const unsigned char *makeTclTag (
static boolean match (const unsigned char *line, const char *word)
{
return (boolean) (strncmp ((const char*) line, word, strlen (word)) == 0);
size_t len = strlen (word);
boolean matched = (strncmp ((const char*) line, word, len) == 0);
if (matched)
{
/* check that the word is followed by a space to avoid detecting something
* like "proc_new ..." */
matched = isspace (*(line + len));
}
return matched;
}
static void findTclTags (void)