[gnome-builder/gnome-builder-3-20] ctags: ignore symlinks when mining directory tree



commit e1f396c682bc395461db444816fa9a4af387ad57
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 5 15:00:28 2016 +0300

    ctags: ignore symlinks when mining directory tree
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757778

 plugins/ctags/ide-ctags-service.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plugins/ctags/ide-ctags-service.c b/plugins/ctags/ide-ctags-service.c
index 0407801..ff97af5 100644
--- a/plugins/ctags/ide-ctags-service.c
+++ b/plugins/ctags/ide-ctags-service.c
@@ -285,6 +285,7 @@ ide_ctags_service_mine_directory (IdeCtagsService *self,
     return;
 
   enumerator = g_file_enumerate_children (directory,
+                                          G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK","
                                           G_FILE_ATTRIBUTE_STANDARD_NAME","
                                           G_FILE_ATTRIBUTE_STANDARD_TYPE,
                                           G_FILE_QUERY_INFO_NONE,
@@ -297,11 +298,15 @@ ide_ctags_service_mine_directory (IdeCtagsService *self,
   while ((infoptr = g_file_enumerator_next_file (enumerator, cancellable, NULL)))
     {
       g_autoptr(GFileInfo) file_info = infoptr;
-      const gchar *name = g_file_info_get_name (file_info);
       GFileType type = g_file_info_get_file_type (file_info);
 
+      if (g_file_info_get_is_symlink (file_info))
+        continue;
+
       if (type == G_FILE_TYPE_DIRECTORY)
         {
+          const gchar *name = g_file_info_get_name (file_info);
+
           child = g_file_get_child (directory, name);
           ide_ctags_service_mine_directory (self, child, recurse, cancellable);
           g_clear_object (&child);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]