mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
Ignore anomalous environment entries which are not of the form
2005-07-10 Matthias Clasen <mclasen@redhat.com> * glib/gutils.c (g_listenv): Ignore anomalous environment entries which are not of the form variable=value. (#309859, Morten Welinder)
This commit is contained in:
committed by
Matthias Clasen
parent
3baeda095b
commit
35425ca9d6
@@ -1,3 +1,9 @@
|
|||||||
|
2005-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* 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 <tml@novell.com>
|
2005-07-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c: Totally rewritten socket channel
|
* glib/giowin32.c: Totally rewritten socket channel
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
2005-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* 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 <tml@novell.com>
|
2005-07-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c: Totally rewritten socket channel
|
* glib/giowin32.c: Totally rewritten socket channel
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
2005-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* 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 <tml@novell.com>
|
2005-07-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c: Totally rewritten socket channel
|
* glib/giowin32.c: Totally rewritten socket channel
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
2005-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* 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 <tml@novell.com>
|
2005-07-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c: Totally rewritten socket channel
|
* glib/giowin32.c: Totally rewritten socket channel
|
||||||
|
@@ -1341,18 +1341,20 @@ gchar **
|
|||||||
g_listenv (void)
|
g_listenv (void)
|
||||||
{
|
{
|
||||||
gchar **result, *eq;
|
gchar **result, *eq;
|
||||||
gint len, i;
|
gint len, i, j;
|
||||||
|
|
||||||
len = g_strv_length (environ);
|
len = g_strv_length (environ);
|
||||||
result = g_new0 (gchar *, len + 1);
|
result = g_new0 (gchar *, len + 1);
|
||||||
|
|
||||||
|
j = 0;
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
eq = strchr (environ[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;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user