On Windows, convert filetype extensions read from config files to lower case (closes #3028856).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5105 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2010-07-13 20:53:25 +00:00
parent 702956d65a
commit 441b37589e
2 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2010-07-13 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/filetypes.c:
On Windows, convert filetype extensions read from config files
to lower case (closes #3028856).
2010-07-12 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2010-07-12 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keybindings.c: * src/keybindings.c:

View File

@ -1571,6 +1571,18 @@ gboolean filetypes_parse_error_message(GeanyFiletype *ft, const gchar *message,
} }
#ifdef G_OS_WIN32
static void convert_filetype_extensions_to_lower_case(gchar **patterns, gsize len)
{
guint i;
for (i = 0; i < len; i++)
{
setptr(patterns[i], g_ascii_strdown(patterns[i], -1));
}
}
#endif
void filetypes_read_extensions(void) void filetypes_read_extensions(void)
{ {
guint i; guint i;
@ -1597,6 +1609,9 @@ void filetypes_read_extensions(void)
{ {
g_strfreev(filetypes[i]->pattern); g_strfreev(filetypes[i]->pattern);
filetypes[i]->pattern = list; filetypes[i]->pattern = list;
#ifdef G_OS_WIN32
convert_filetype_extensions_to_lower_case(filetypes[i]->pattern, len);
#endif
} }
else else
g_strfreev(list); g_strfreev(list);