Fix 319806

This commit is contained in:
Matthias Clasen 2005-10-26 13:10:55 +00:00
parent 72d021598f
commit 79fa3efec2
4 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2005-10-26 Matthias Clasen <mclasen@redhat.com>
* glib/gutf8.c (g_ucs4_to_utf8): Don't set items_read twice
in the error case, and add some documentation. (#319806, Morten
Welinder)
2005-10-19 Manish Singh <yosh@gimp.org> 2005-10-19 Manish Singh <yosh@gimp.org>
* configure.in: Use AC_CHECK_FUNCS for _NSGetEnviron, to get the * configure.in: Use AC_CHECK_FUNCS for _NSGetEnviron, to get the

View File

@ -1,3 +1,9 @@
2005-10-26 Matthias Clasen <mclasen@redhat.com>
* glib/gutf8.c (g_ucs4_to_utf8): Don't set items_read twice
in the error case, and add some documentation. (#319806, Morten
Welinder)
2005-10-19 Manish Singh <yosh@gimp.org> 2005-10-19 Manish Singh <yosh@gimp.org>
* configure.in: Use AC_CHECK_FUNCS for _NSGetEnviron, to get the * configure.in: Use AC_CHECK_FUNCS for _NSGetEnviron, to get the

View File

@ -1,3 +1,9 @@
2005-10-26 Matthias Clasen <mclasen@redhat.com>
* glib/gutf8.c (g_ucs4_to_utf8): Don't set items_read twice
in the error case, and add some documentation. (#319806, Morten
Welinder)
2005-10-19 Manish Singh <yosh@gimp.org> 2005-10-19 Manish Singh <yosh@gimp.org>
* configure.in: Use AC_CHECK_FUNCS for _NSGetEnviron, to get the * configure.in: Use AC_CHECK_FUNCS for _NSGetEnviron, to get the

View File

@ -958,7 +958,9 @@ g_utf8_to_ucs4 (const gchar *str,
* Return value: a pointer to a newly allocated UTF-8 string. * Return value: a pointer to a newly allocated UTF-8 string.
* This value must be freed with g_free(). If an * This value must be freed with g_free(). If an
* error occurs, %NULL will be returned and * error occurs, %NULL will be returned and
* @error set. * @error set. In that case, @items_read will be
* set to the position of the first invalid input
* character.
**/ **/
gchar * gchar *
g_ucs4_to_utf8 (const gunichar *str, g_ucs4_to_utf8 (const gunichar *str,
@ -980,9 +982,6 @@ g_ucs4_to_utf8 (const gunichar *str,
if (str[i] >= 0x80000000) if (str[i] >= 0x80000000)
{ {
if (items_read)
*items_read = i;
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
_("Character out of range for UTF-8")); _("Character out of range for UTF-8"));
goto err_out; goto err_out;