From 66f109711ab8dde782b34c25b523861369ecefbd Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 1 Jan 2005 16:55:10 +0000 Subject: [PATCH] Make the g_getenv() ABI backward compatibility wrapper more robust. 2005-01-01 Tor Lillqvist * glib/gutils.c: Make the g_getenv() ABI backward compatibility wrapper more robust. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/gutils.c | 8 ++++++-- 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index da15a34bb..046332429 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-01 Tor Lillqvist + + * glib/gutils.c: Make the g_getenv() ABI backward compatibility + wrapper more robust. + 2005-01-01 Tor Lillqvist * glib/glib.symbols diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index da15a34bb..046332429 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-01-01 Tor Lillqvist + + * glib/gutils.c: Make the g_getenv() ABI backward compatibility + wrapper more robust. + 2005-01-01 Tor Lillqvist * glib/glib.symbols diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index da15a34bb..046332429 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2005-01-01 Tor Lillqvist + + * glib/gutils.c: Make the g_getenv() ABI backward compatibility + wrapper more robust. + 2005-01-01 Tor Lillqvist * glib/glib.symbols diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index da15a34bb..046332429 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2005-01-01 Tor Lillqvist + + * glib/gutils.c: Make the g_getenv() ABI backward compatibility + wrapper more robust. + 2005-01-01 Tor Lillqvist * glib/glib.symbols diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index da15a34bb..046332429 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-01-01 Tor Lillqvist + + * glib/gutils.c: Make the g_getenv() ABI backward compatibility + wrapper more robust. + 2005-01-01 Tor Lillqvist * glib/glib.symbols diff --git a/glib/gutils.c b/glib/gutils.c index 5c92aba1b..c7de24123 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -2386,10 +2386,14 @@ g_getenv (const gchar *variable) { gchar *utf8_variable = g_locale_to_utf8 (variable, -1, NULL, NULL, NULL); const gchar *utf8_value = g_getenv_utf8 (utf8_variable); - gchar *value = g_locale_from_utf8 (utf8_value, -1, NULL, NULL, NULL); - GQuark quark = g_quark_from_string (value); + gchar *value; + GQuark quark; g_free (utf8_variable); + if (!utf8_value) + return NULL; + value = g_locale_from_utf8 (utf8_value, -1, NULL, NULL, NULL); + quark = g_quark_from_string (value); g_free (value); return g_quark_to_string (quark);