[gnome-session/gnome-3-20] autostart-app: initialize i from previous commit



commit 681b9ab5905be4f7e265cc930c2de8e973f6a34b
Author: Ray Strode <rstrode redhat com>
Date:   Mon Mar 7 15:54:46 2016 -0500

    autostart-app: initialize i from previous commit
    
    We weren't initializing it to 0.
    
    This commit changes the while loop to a for loop to
    make room for  a natural place to initialize i.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754941

 gnome-session/gsm-autostart-app.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
index 5b74bd4..1dc3ba3 100644
--- a/gnome-session/gsm-autostart-app.c
+++ b/gnome-session/gsm-autostart-app.c
@@ -1073,7 +1073,7 @@ autostart_app_start_spawn (GsmAutostartApp *app,
         ctx = g_app_launch_context_new ();
 
         child_environment = gsm_util_listenv ();
-        while (child_environment[i] != NULL) {
+        for (i = 0; child_environment[i] != NULL; i++) {
                 char **environment_tuple;
                 const char *key;
                 const char *value;
@@ -1086,7 +1086,6 @@ autostart_app_start_spawn (GsmAutostartApp *app,
                         g_app_launch_context_setenv (ctx, key, value);
 
                 g_strfreev (environment_tuple);
-                i++;
         }
 
         if (startup_id != NULL) {


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