[gnome-session/wip/rstrode/kill-bus-clients: 1/4] shell-extension: fix warning when iterating over extension list



commit c1a8e4c6e3aee647487caf2fc67a7560aed3d740
Author: Ray Strode <rstrode redhat com>
Date:   Tue Jun 20 15:27:16 2017 -0400

    shell-extension: fix warning when iterating over extension list
    
    This should fix this warning:
    
    gnome-session/gnome-session/gsm-shell-extensions.c: In function ‘gsm_shell_extensions_scan’:
    gnome-session/gnome-session/gsm-shell-extensions.c:145:30: warning: comparison between pointer and zero 
character constant [-Wpointer-compare]
       while ((*system_data_dirs) != '\0')
                                  ^~
    gnome-session/gnome-session/gsm-shell-extensions.c:145:10: note: did you mean to dereference the pointer?
       while ((*system_data_dirs) != '\0')

 gnome-session/gsm-shell-extensions.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gnome-session/gsm-shell-extensions.c b/gnome-session/gsm-shell-extensions.c
index 4ec8829..73d898f 100644
--- a/gnome-session/gsm-shell-extensions.c
+++ b/gnome-session/gsm-shell-extensions.c
@@ -132,6 +132,7 @@ gsm_shell_extensions_scan (GsmShellExtensions *self)
   gchar *dirname;
   GFile *dir;
   const gchar * const * system_data_dirs;
+  int                   i;
 
   /* User data dir first. */
   dirname = g_build_filename (g_get_user_data_dir (), "gnome-shell", "extensions", NULL);
@@ -142,15 +143,14 @@ gsm_shell_extensions_scan (GsmShellExtensions *self)
   g_object_unref (dir);
 
   system_data_dirs = g_get_system_data_dirs ();
-  while ((*system_data_dirs) != '\0')
+  for (i = 0; system_data_dirs[i]; i++)
     {
-      dirname = g_build_filename (*system_data_dirs, "gnome-shell", "extensions", NULL);
+      dirname = g_build_filename (system_data_dirs[i], "gnome-shell", "extensions", NULL);
       dir = g_file_new_for_path (dirname);
       g_free (dirname);
 
       gsm_shell_extensions_scan_dir (self, dir);
       g_object_unref (dir);
-      system_data_dirs ++;
     }
 }
 


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