Don't crash if G_FILENAME_ENCODING is empty. (#164330, Pawel Sakowski)

2005-01-17  Matthias Clasen  <mclasen@redhat.com>

	* glib/gconvert.c (g_get_filename_charsets): Don't crash
	if G_FILENAME_ENCODING is empty.  (#164330, Pawel Sakowski)
This commit is contained in:
Matthias Clasen 2005-01-17 15:28:59 +00:00 committed by Matthias Clasen
parent 987a7b011e
commit b403b41e15
5 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-01-17 Matthias Clasen <mclasen@redhat.com>
* glib/gconvert.c (g_get_filename_charsets): Don't crash
if G_FILENAME_ENCODING is empty. (#164330, Pawel Sakowski)
2005-01-15 Tor Lillqvist <tlillqvist@novell.com> 2005-01-15 Tor Lillqvist <tlillqvist@novell.com>
* configure.in: sh portability fix. Use "test" and not [. * configure.in: sh portability fix. Use "test" and not [.

View File

@ -1,3 +1,8 @@
2005-01-17 Matthias Clasen <mclasen@redhat.com>
* glib/gconvert.c (g_get_filename_charsets): Don't crash
if G_FILENAME_ENCODING is empty. (#164330, Pawel Sakowski)
2005-01-15 Tor Lillqvist <tlillqvist@novell.com> 2005-01-15 Tor Lillqvist <tlillqvist@novell.com>
* configure.in: sh portability fix. Use "test" and not [. * configure.in: sh portability fix. Use "test" and not [.

View File

@ -1,3 +1,8 @@
2005-01-17 Matthias Clasen <mclasen@redhat.com>
* glib/gconvert.c (g_get_filename_charsets): Don't crash
if G_FILENAME_ENCODING is empty. (#164330, Pawel Sakowski)
2005-01-15 Tor Lillqvist <tlillqvist@novell.com> 2005-01-15 Tor Lillqvist <tlillqvist@novell.com>
* configure.in: sh portability fix. Use "test" and not [. * configure.in: sh portability fix. Use "test" and not [.

View File

@ -1,3 +1,8 @@
2005-01-17 Matthias Clasen <mclasen@redhat.com>
* glib/gconvert.c (g_get_filename_charsets): Don't crash
if G_FILENAME_ENCODING is empty. (#164330, Pawel Sakowski)
2005-01-15 Tor Lillqvist <tlillqvist@novell.com> 2005-01-15 Tor Lillqvist <tlillqvist@novell.com>
* configure.in: sh portability fix. Use "test" and not [. * configure.in: sh portability fix. Use "test" and not [.

View File

@ -1070,7 +1070,7 @@ g_get_filename_charsets (G_CONST_RETURN gchar ***filename_charsets)
cache->charset = g_strdup (charset); cache->charset = g_strdup (charset);
p = getenv ("G_FILENAME_ENCODING"); p = getenv ("G_FILENAME_ENCODING");
if (p != NULL) if (p != NULL && p[0] != '\0')
{ {
cache->filename_charsets = g_strsplit (p, ",", 0); cache->filename_charsets = g_strsplit (p, ",", 0);
cache->is_utf8 = (strcmp (cache->filename_charsets[0], "UTF-8") == 0); cache->is_utf8 = (strcmp (cache->filename_charsets[0], "UTF-8") == 0);