From 6e630eb8aebd8f77cf4144fee51ebb66d702ecb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Fri, 25 May 2007 15:19:23 +0000 Subject: [PATCH] Add shebank-like detection for XML files. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1573 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 1 + src/filetypes.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index afcbda54..9e723ee4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ * geany.glade, src/callbacks.c, src/callbacks.h, src/geany.h, src/interface.c, src/main.c, src/ui_utils.c: Improve sensitivity of recent files sub menus. + * src/filetypes.c: Add shebank-like detection for XML files. 2007-05-25 Nick Treleaven diff --git a/src/filetypes.c b/src/filetypes.c index dcb992f2..7fad28b4 100644 --- a/src/filetypes.c +++ b/src/filetypes.c @@ -574,7 +574,7 @@ static filetype *find_shebang(gint idx) gchar *line = sci_get_line(doc_list[idx].sci, 0); filetype *ft = NULL; - if (strlen(line) > 2 && line[0] == '#' && line[1]=='!') + if (strlen(line) > 2 && line[0] == '#' && line[1] == '!') { /// TODO does g_path_get_basename() also work under Win32 for Unix filenames? gchar *basename_interpreter = g_path_get_basename(line + 2); @@ -609,6 +609,20 @@ static filetype *find_shebang(gint idx) g_free(basename_interpreter); } + // detect XML files + if (strncmp(line, "