[glib] glib/tests/enviroment.c: Fix running on Windows



commit 29b66e1458113e1786209f5784f919082d22c618
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Nov 26 18:57:04 2013 +0800

    glib/tests/enviroment.c: Fix running on Windows
    
    Don't attempt to insert environmental variables in the hash table during
    the test listenv that is an empty string, as GetEnvironmentStringsW() also
    returns special enviroment variables which have empty strings as their
    variable names, at least on Windows 7 and 8.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711047

 glib/tests/environment.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/glib/tests/environment.c b/glib/tests/environment.c
index 36c875b..65ee7b0 100644
--- a/glib/tests/environment.c
+++ b/glib/tests/environment.c
@@ -17,7 +17,8 @@ test_listenv (void)
 
       parts = g_strsplit (list[i], "=", 2);
       g_assert (g_hash_table_lookup (table, parts[0]) == NULL);
-      g_hash_table_insert (table, parts[0], parts[1]);
+      if (g_strcmp0 (parts[0], ""))
+        g_hash_table_insert (table, parts[0], parts[1]);
       g_free (parts);
     }
   g_strfreev (list);


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