Fix file type detection for parsers using regexp code with non-standard file type extensions.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2058 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2007-11-19 14:34:02 +00:00
parent 26f6490c41
commit e6fb5a8ac8
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2007-11-19 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/read.c: Fix file type detection for parsers using regexp
code with non-standard file type extensions.
2007-11-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* doc/geany.html, doc/geany.txt, src/keyfile.c, src/plugindata.h,

View File

@ -66,7 +66,7 @@ static void setInputFileName (const char *const fileName)
vStringNCopyS (File.path, fileName, length);
}
}
static void setSourceFileParameters (vString *const fileName)
static void setSourceFileParameters (vString *const fileName, const langType language)
{
if (File.source.name != NULL)
vStringDelete (File.source.name);
@ -84,7 +84,10 @@ static void setSourceFileParameters (vString *const fileName)
TagFile.max.file = vStringLength (fileName);
File.source.isHeader = isIncludeFile (vStringValue (fileName));
File.source.language = getFileLanguage (vStringValue (fileName));
if (language != -1)
File.source.language = language;
else
File.source.language = getFileLanguage (vStringValue (fileName));
}
static boolean setSourceFileName (vString *const fileName)
@ -98,7 +101,7 @@ static boolean setSourceFileName (vString *const fileName)
else
pathName = combinePathAndFile (vStringValue (File.path),
vStringValue (fileName));
setSourceFileParameters (pathName);
setSourceFileParameters (pathName, -1);
result = TRUE;
}
return result;
@ -270,7 +273,7 @@ extern boolean fileOpen (const char *const fileName, const langType language)
if (File.line != NULL)
vStringClear (File.line);
setSourceFileParameters (vStringNewInit (fileName));
setSourceFileParameters (vStringNewInit (fileName), language);
File.source.lineNumber = 0L;
verbose ("OPENING %s as %s language %sfile\n", fileName,