From 369c7bb51ca200aa80765ee28b4a9c56ee6284c2 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 5 Apr 2007 12:07:46 +0000 Subject: [PATCH] Make \" filename quoting optional when creating a global tags file (quoting is useful if glob matching is needed). Run geany -g for example usage. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1439 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 4 ++++ src/symbols.c | 3 +-- tagmanager/tm_workspace.c | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d3b5ad2..d67cc08e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,10 @@ Find in Files section. * src/keybindings.c: Only construct-complete when the editor widget has focus. + * src/symbols.c, tagmanager/tm_workspace.c: + Make \" filename quoting optional when creating a global tags file + (quoting is useful if glob matching is needed). Run geany -g for + example usage. 2007-04-03 Nick Treleaven diff --git a/src/symbols.c b/src/symbols.c index a2540ea0..a4d6b59d 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -724,10 +724,9 @@ int symbols_generate_global_tags(int argc, char **argv) else { fprintf(stderr, "Usage: %s -g \n\n", argv[0]); - fprintf(stderr, "Each file in must be enclosed in double quotes.\n"); fprintf(stderr, "Example:\n" "CFLAGS=`pkg-config gtk+-2.0 --cflags` %s -g gtk2.c.tags" - " \\\"/usr/include/gtk-2.0/gtk/gtk.h\\\"\n", argv[0]); + " /usr/include/gtk-2.0/gtk/gtk.h\n", argv[0]); return 1; } return 0; diff --git a/tagmanager/tm_workspace.c b/tagmanager/tm_workspace.c index 5bada791..29a34f90 100644 --- a/tagmanager/tm_workspace.c +++ b/tagmanager/tm_workspace.c @@ -219,6 +219,8 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i #ifdef HAVE_GLOB_H globbuf.gl_offs = 0; + + if (includes[0][0] == '"') // leading \" char for glob matching for(idx_inc = 0; idx_inc < includes_count; idx_inc++) { int dirty_len = strlen(includes[idx_inc]); @@ -254,7 +256,8 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i globfree(&globbuf); free(clean_path); } -#else // no glob support + else +#endif for(idx_inc = 0; idx_inc < includes_count; idx_inc++) { if (!g_hash_table_lookup(includes_files_hash, @@ -265,8 +268,6 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i file_name_copy); } } -#endif - /* Checks for duplicate file entries which would case trouble */ g_hash_table_foreach(includes_files_hash, tm_move_entries_to_g_list,