[gnome-builder] util: don't follow through symlinks when populating



commit 9b3800ebc595c1ed0610ab38f3358dd703dfd206
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 15 13:31:46 2018 -0800

    util: don't follow through symlinks when populating
    
    We can get into async loops here, so just avoid following symlinks.
    
    Fixes #407

 src/libide/util/ide-glib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/util/ide-glib.c b/src/libide/util/ide-glib.c
index d695345ae..e56d0f4be 100644
--- a/src/libide/util/ide-glib.c
+++ b/src/libide/util/ide-glib.c
@@ -418,6 +418,7 @@ populate_descendants_matching (GFile        *file,
 
   enumerator = g_file_enumerate_children (file,
                                           G_FILE_ATTRIBUTE_STANDARD_NAME","
+                                          G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK","
                                           G_FILE_ATTRIBUTE_STANDARD_TYPE,
                                           G_FILE_QUERY_INFO_NONE,
                                           cancellable,
@@ -441,7 +442,7 @@ populate_descendants_matching (GFile        *file,
       if (g_pattern_match_string (spec, name))
         g_ptr_array_add (results, g_file_enumerator_get_child (enumerator, info));
 
-      if (file_type == G_FILE_TYPE_DIRECTORY)
+      if (!g_file_info_get_is_symlink (info) && file_type == G_FILE_TYPE_DIRECTORY)
         {
           if (children == NULL)
             children = g_ptr_array_new_with_free_func (g_object_unref);


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