From: Matthias Clasen Date: Sun, 10 Jul 2005 04:44:27 +0000 (+0000) Subject: Ignore anomalous environment entries which are not of the form X-Git-Tag: GLIB_2_7_3~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35425ca9d6be66a9484c853435df23c8ddb6547b;p=platform%2Fupstream%2Fglib.git Ignore anomalous environment entries which are not of the form 2005-07-10 Matthias Clasen * glib/gutils.c (g_listenv): Ignore anomalous environment entries which are not of the form variable=value. (#309859, Morten Welinder) --- diff --git a/ChangeLog b/ChangeLog index b8e95e1..d6cf06f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-07-10 Matthias Clasen + + * glib/gutils.c (g_listenv): Ignore anomalous environment + entries which are not of the form variable=value. (#309859, + Morten Welinder) + 2005-07-09 Tor Lillqvist * glib/giowin32.c: Totally rewritten socket channel diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b8e95e1..d6cf06f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-07-10 Matthias Clasen + + * glib/gutils.c (g_listenv): Ignore anomalous environment + entries which are not of the form variable=value. (#309859, + Morten Welinder) + 2005-07-09 Tor Lillqvist * glib/giowin32.c: Totally rewritten socket channel diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index b8e95e1..d6cf06f 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2005-07-10 Matthias Clasen + + * glib/gutils.c (g_listenv): Ignore anomalous environment + entries which are not of the form variable=value. (#309859, + Morten Welinder) + 2005-07-09 Tor Lillqvist * glib/giowin32.c: Totally rewritten socket channel diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b8e95e1..d6cf06f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-07-10 Matthias Clasen + + * glib/gutils.c (g_listenv): Ignore anomalous environment + entries which are not of the form variable=value. (#309859, + Morten Welinder) + 2005-07-09 Tor Lillqvist * glib/giowin32.c: Totally rewritten socket channel diff --git a/glib/gutils.c b/glib/gutils.c index ffa8968..e59f280 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -1341,18 +1341,20 @@ gchar ** g_listenv (void) { gchar **result, *eq; - gint len, i; + gint len, i, j; len = g_strv_length (environ); result = g_new0 (gchar *, len + 1); + j = 0; for (i = 0; i < len; i++) { eq = strchr (environ[i], '='); - result[i] = g_strndup (environ[i], eq - environ[i]); + if (eq) + result[j++] = g_strndup (environ[i], eq - environ[i]); } - result[len] = NULL; + result[j] = NULL; return result; }