Kaydet (Commit) 369c7bb5 authored tarafından Nick Treleaven's avatar Nick Treleaven

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
üst 4e13a556
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
Find in Files section. Find in Files section.
* src/keybindings.c: * src/keybindings.c:
Only construct-complete when the editor widget has focus. 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 <nick.treleaven@btinternet.com> 2007-04-03 Nick Treleaven <nick.treleaven@btinternet.com>
......
...@@ -724,10 +724,9 @@ int symbols_generate_global_tags(int argc, char **argv) ...@@ -724,10 +724,9 @@ int symbols_generate_global_tags(int argc, char **argv)
else else
{ {
fprintf(stderr, "Usage: %s -g <Tag File> <File list>\n\n", argv[0]); fprintf(stderr, "Usage: %s -g <Tag File> <File list>\n\n", argv[0]);
fprintf(stderr, "Each file in <File list> must be enclosed in double quotes.\n");
fprintf(stderr, "Example:\n" fprintf(stderr, "Example:\n"
"CFLAGS=`pkg-config gtk+-2.0 --cflags` %s -g gtk2.c.tags" "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 1;
} }
return 0; return 0;
......
...@@ -219,6 +219,8 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i ...@@ -219,6 +219,8 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i
#ifdef HAVE_GLOB_H #ifdef HAVE_GLOB_H
globbuf.gl_offs = 0; globbuf.gl_offs = 0;
if (includes[0][0] == '"') // leading \" char for glob matching
for(idx_inc = 0; idx_inc < includes_count; idx_inc++) for(idx_inc = 0; idx_inc < includes_count; idx_inc++)
{ {
int dirty_len = strlen(includes[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 ...@@ -254,7 +256,8 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i
globfree(&globbuf); globfree(&globbuf);
free(clean_path); free(clean_path);
} }
#else // no glob support else
#endif
for(idx_inc = 0; idx_inc < includes_count; idx_inc++) for(idx_inc = 0; idx_inc < includes_count; idx_inc++)
{ {
if (!g_hash_table_lookup(includes_files_hash, 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 ...@@ -265,8 +268,6 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i
file_name_copy); file_name_copy);
} }
} }
#endif
/* Checks for duplicate file entries which would case trouble */ /* Checks for duplicate file entries which would case trouble */
g_hash_table_foreach(includes_files_hash, tm_move_entries_to_g_list, g_hash_table_foreach(includes_files_hash, tm_move_entries_to_g_list,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment