From 8fa63e43c858c1a531af1515d065245686a41749 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Wed, 6 Aug 2003 01:08:46 +0000 Subject: [PATCH] Get rid of "len" parameter to output_special_case and output_marks, and 2003-08-05 Noah Levitt * glib/guniprop.c: Get rid of "len" parameter to output_special_case and output_marks, and make them work more like g_unichar_to_utf8, fixing a bug in the process. (#118957) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-12 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ glib/guniprop.c | 18 +++++++++--------- 7 files changed, 45 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b423f1..9c34e68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-08-05 Noah Levitt + + * glib/guniprop.c: Get rid of "len" parameter to output_special_case + and output_marks, and make them work more like g_unichar_to_utf8, + fixing a bug in the process. (#118957) + 2003-08-05 Hans Breuer * glib/gnulib/makefile.msc : (new file) for msvc build diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1b423f1..9c34e68 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2003-08-05 Noah Levitt + + * glib/guniprop.c: Get rid of "len" parameter to output_special_case + and output_marks, and make them work more like g_unichar_to_utf8, + fixing a bug in the process. (#118957) + 2003-08-05 Hans Breuer * glib/gnulib/makefile.msc : (new file) for msvc build diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 1b423f1..9c34e68 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2003-08-05 Noah Levitt + + * glib/guniprop.c: Get rid of "len" parameter to output_special_case + and output_marks, and make them work more like g_unichar_to_utf8, + fixing a bug in the process. (#118957) + 2003-08-05 Hans Breuer * glib/gnulib/makefile.msc : (new file) for msvc build diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 1b423f1..9c34e68 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +2003-08-05 Noah Levitt + + * glib/guniprop.c: Get rid of "len" parameter to output_special_case + and output_marks, and make them work more like g_unichar_to_utf8, + fixing a bug in the process. (#118957) + 2003-08-05 Hans Breuer * glib/gnulib/makefile.msc : (new file) for msvc build diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 1b423f1..9c34e68 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2003-08-05 Noah Levitt + + * glib/guniprop.c: Get rid of "len" parameter to output_special_case + and output_marks, and make them work more like g_unichar_to_utf8, + fixing a bug in the process. (#118957) + 2003-08-05 Hans Breuer * glib/gnulib/makefile.msc : (new file) for msvc build diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 1b423f1..9c34e68 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2003-08-05 Noah Levitt + + * glib/guniprop.c: Get rid of "len" parameter to output_special_case + and output_marks, and make them work more like g_unichar_to_utf8, + fixing a bug in the process. (#118957) + 2003-08-05 Hans Breuer * glib/gnulib/makefile.msc : (new file) for msvc build diff --git a/glib/guniprop.c b/glib/guniprop.c index 5b3d6a1..a76452b 100644 --- a/glib/guniprop.c +++ b/glib/guniprop.c @@ -544,13 +544,13 @@ get_locale_type (void) return LOCALE_NORMAL; } -static int +static gint output_marks (const char **p_inout, char *out_buffer, - int len, gboolean remove_dot) { const char *p = *p_inout; + gint len = 0; while (*p) { @@ -560,7 +560,7 @@ output_marks (const char **p_inout, if (ISMARK(t)) { if (!remove_dot || c != 0x307 /* COMBINING DOT ABOVE */) - len += g_unichar_to_utf8 (c, out_buffer ? out_buffer + len : NULL); + len += g_unichar_to_utf8 (c, out_buffer); p = g_utf8_next_char (p); } else @@ -571,14 +571,14 @@ output_marks (const char **p_inout, return len; } -static gsize +static gint output_special_case (gchar *out_buffer, - gsize len, int offset, int type, int which) { const guchar *p = special_case_table + offset; + gint len; if (type != G_UNICODE_TITLECASE_LETTER) p = g_utf8_next_char (p); @@ -636,7 +636,7 @@ real_toupper (const gchar *str, } g_free (decomp); - len = output_marks (&p, out_buffer, len, TRUE); + len += output_marks (&p, out_buffer ? out_buffer + len : NULL, TRUE); continue; } @@ -656,7 +656,7 @@ real_toupper (const gchar *str, /* Nasty, need to move it after other combining marks .. this would go away if * we normalized first. */ - len = output_marks (&p, out_buffer, len, FALSE); + len += output_marks (&p, out_buffer ? out_buffer + len : NULL, FALSE); /* And output as GREEK CAPITAL LETTER IOTA */ len += g_unichar_to_utf8 (0x399, out_buffer ? out_buffer + len : NULL); @@ -667,7 +667,7 @@ real_toupper (const gchar *str, if (val >= 0x1000000) { - len += output_special_case (out_buffer, len, val - 0x1000000, t, + len += output_special_case (out_buffer ? out_buffer + len : NULL, val - 0x1000000, t, t == G_UNICODE_LOWERCASE_LETTER ? 0 : 1); } else @@ -790,7 +790,7 @@ real_tolower (const gchar *str, if (val >= 0x1000000) { - len += output_special_case (out_buffer, len, val - 0x1000000, t, 0); + len += output_special_case (out_buffer ? out_buffer + len : NULL, val - 0x1000000, t, 0); } else { -- 2.7.4