Check for NULL before doing anything.

Tue Dec  3 01:05:00 2002  James M. Cape  <jcape@ignore-your.tv>

	* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
	Check for NULL before doing anything.
This commit is contained in:
James M. Cape 2002-12-03 07:07:38 +00:00 committed by James M. Cape
parent e2afe00eb1
commit 96aa6ab873
8 changed files with 61 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Tue Dec 3 01:05:00 2002 James M. Cape <jcape@ignore-your.tv>
* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
Check for NULL before doing anything.
Mon Dec 2 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* === Released 2.1.3 ===

View File

@ -1,3 +1,8 @@
Tue Dec 3 01:05:00 2002 James M. Cape <jcape@ignore-your.tv>
* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
Check for NULL before doing anything.
Mon Dec 2 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* === Released 2.1.3 ===

View File

@ -1,3 +1,8 @@
Tue Dec 3 01:05:00 2002 James M. Cape <jcape@ignore-your.tv>
* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
Check for NULL before doing anything.
Mon Dec 2 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* === Released 2.1.3 ===

View File

@ -1,3 +1,8 @@
Tue Dec 3 01:05:00 2002 James M. Cape <jcape@ignore-your.tv>
* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
Check for NULL before doing anything.
Mon Dec 2 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* === Released 2.1.3 ===

View File

@ -1,3 +1,8 @@
Tue Dec 3 01:05:00 2002 James M. Cape <jcape@ignore-your.tv>
* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
Check for NULL before doing anything.
Mon Dec 2 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* === Released 2.1.3 ===

View File

@ -1,3 +1,8 @@
Tue Dec 3 01:05:00 2002 James M. Cape <jcape@ignore-your.tv>
* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
Check for NULL before doing anything.
Mon Dec 2 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* === Released 2.1.3 ===

View File

@ -1,3 +1,8 @@
Tue Dec 3 01:05:00 2002 James M. Cape <jcape@ignore-your.tv>
* glib/gunicollate.c (g_utf8_collate, g_utf8_collate_key):
Check for NULL before doing anything.
Mon Dec 2 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* === Released 2.1.3 ===

View File

@ -53,8 +53,14 @@ g_utf8_collate (const gchar *str1,
#ifdef __STDC_ISO_10646__
gunichar *str1_norm = _g_utf8_normalize_wc (str1, -1, G_NORMALIZE_ALL_COMPOSE);
gunichar *str2_norm = _g_utf8_normalize_wc (str2, -1, G_NORMALIZE_ALL_COMPOSE);
gunichar *str1_norm;
gunichar *str2_norm;
g_return_val_if_fail (str1 != NULL, 0);
g_return_val_if_fail (str2 != NULL, 0);
str1_norm = _g_utf8_normalize_wc (str1, -1, G_NORMALIZE_ALL_COMPOSE);
str2_norm = _g_utf8_normalize_wc (str2, -1, G_NORMALIZE_ALL_COMPOSE);
result = wcscoll ((wchar_t *)str1_norm, (wchar_t *)str2_norm);
@ -64,8 +70,14 @@ g_utf8_collate (const gchar *str1,
#else /* !__STDC_ISO_10646__ */
const gchar *charset;
gchar *str1_norm = g_utf8_normalize (str1, -1, G_NORMALIZE_ALL_COMPOSE);
gchar *str2_norm = g_utf8_normalize (str2, -1, G_NORMALIZE_ALL_COMPOSE);
gchar *str1_norm;
gchar *str2_norm;
g_return_val_if_fail (str1 != NULL, 0);
g_return_val_if_fail (str2 != NULL, 0);
str1_norm = g_utf8_normalize (str1, -1, G_NORMALIZE_ALL_COMPOSE);
str2_norm = g_utf8_normalize (str2, -1, G_NORMALIZE_ALL_COMPOSE);
if (g_get_charset (&charset))
{
@ -169,11 +181,15 @@ g_utf8_collate_key (const gchar *str,
#ifdef __STDC_ISO_10646__
gunichar *str_norm = _g_utf8_normalize_wc (str, len, G_NORMALIZE_ALL_COMPOSE);
gunichar *str_norm;
wchar_t *result_wc;
size_t i;
size_t result_len = 0;
g_return_val_if_fail (str1 != NULL, NULL);
str_norm = _g_utf8_normalize_wc (str, len, G_NORMALIZE_ALL_COMPOSE);
setlocale (LC_COLLATE, "");
xfrm_len = wcsxfrm (NULL, (wchar_t *)str_norm, 0);
@ -197,7 +213,11 @@ g_utf8_collate_key (const gchar *str,
#else /* !__STDC_ISO_10646__ */
const gchar *charset;
gchar *str_norm = g_utf8_normalize (str, len, G_NORMALIZE_ALL_COMPOSE);
gchar *str_norm;
g_return_val_if_fail (str1 != NULL, NULL);
str_norm = g_utf8_normalize (str, len, G_NORMALIZE_ALL_COMPOSE);
if (g_get_charset (&charset))
{