From c5b834629cd11e5fe9ed8f46c9b2c7cfd66acb12 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 17 Mar 2011 17:03:01 +0000 Subject: [PATCH] Make special case for filetypes.matlab instead of truncating all filetype config filenames at slash. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5603 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 3 +++ src/filetypes.c | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a837463..097ab333 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,9 @@ * data/filetypes.Scala.conf, data/filetype_extensions.conf: Add Scala custom filetype, based on file by werg (thanks). (This uses the newly added [styling=C] syntax). + * src/filetypes.c: + Make special case for filetypes.matlab instead of truncating all + filetype config filenames at slash. 2011-03-15 Frank Lanitz diff --git a/src/filetypes.c b/src/filetypes.c index 6c6d89bf..c41ae53a 100644 --- a/src/filetypes.c +++ b/src/filetypes.c @@ -1290,7 +1290,7 @@ void filetypes_load_config(gint ft_id, gboolean reload) gchar *filetypes_get_conf_extension(gint filetype_idx) { - gchar *result, *ptr; + gchar *result; GeanyFiletype *ft = filetypes[filetype_idx]; if (ft->priv->custom) @@ -1303,12 +1303,10 @@ gchar *filetypes_get_conf_extension(gint filetype_idx) case GEANY_FILETYPES_CS: result = g_strdup("cs"); break; case GEANY_FILETYPES_MAKE: result = g_strdup("makefile"); break; case GEANY_FILETYPES_NONE: result = g_strdup("common"); break; + /* name is Matlab/Octave */ + case GEANY_FILETYPES_MATLAB: result = g_strdup("matlab"); break; default: result = g_ascii_strdown(ft->name, -1); - /* truncate at slash (e.g. for Matlab/Octave) */ - ptr = strstr(result, "/"); - if (ptr) - *ptr = 0x0; break; } return result;