summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--ChangeLog.pre-2-011
-rw-r--r--ChangeLog.pre-2-1011
-rw-r--r--ChangeLog.pre-2-1211
-rw-r--r--ChangeLog.pre-2-211
-rw-r--r--ChangeLog.pre-2-411
-rw-r--r--ChangeLog.pre-2-611
-rw-r--r--ChangeLog.pre-2-811
-rw-r--r--gconvert.c2
-rw-r--r--glib/gconvert.c2
-rw-r--r--glib/gutf8.c30
-rw-r--r--gutf8.c30
12 files changed, 120 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog.pre-2-12
+++ b/ChangeLog.pre-2-12
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index d44e5fa32..fe5f01f39 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,14 @@
+2000-12-13 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (open_converter): make static
+
+ * gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
+ speeding it up - now we just return FALSE if we had to bail out
+ for any reason before getting to the end of the string, as defined
+ by a nul byte if len was -1, defined by the len otherwise. This
+ also fixes a bug where nul bytes were not treated as invalid
+ when the length was specified.
+
2000-12-12 Havoc Pennington <hp@pobox.com>
* gmain.c (g_main_context_destroy): don't try to use thread stuff
diff --git a/gconvert.c b/gconvert.c
index d78c0a532..2169b6d4e 100644
--- a/gconvert.c
+++ b/gconvert.c
@@ -80,7 +80,7 @@ g_iconv_close (GIConv converter)
return iconv_close (cd);
}
-GIConv
+static GIConv
open_converter (const gchar *to_codeset,
const gchar *from_codeset,
GError **error)
diff --git a/glib/gconvert.c b/glib/gconvert.c
index d78c0a532..2169b6d4e 100644
--- a/glib/gconvert.c
+++ b/glib/gconvert.c
@@ -80,7 +80,7 @@ g_iconv_close (GIConv converter)
return iconv_close (cd);
}
-GIConv
+static GIConv
open_converter (const gchar *to_codeset,
const gchar *from_codeset,
GError **error)
diff --git a/glib/gutf8.c b/glib/gutf8.c
index 1f31f6e81..f79ab48e3 100644
--- a/glib/gutf8.c
+++ b/glib/gutf8.c
@@ -550,7 +550,6 @@ g_utf8_validate (const gchar *str,
{
const gchar *p;
- gboolean retval = TRUE;
if (end)
*end = str;
@@ -566,34 +565,35 @@ g_utf8_validate (const gchar *str,
UTF8_COMPUTE (c, mask, len);
if (len == -1)
- {
- retval = FALSE;
- break;
- }
+ break;
/* check that the expected number of bytes exists in str */
if (max_len >= 0 &&
((max_len - (p - str)) < len))
- {
- retval = FALSE;
- break;
- }
+ break;
UTF8_GET (result, p, i, mask, len);
if (result == (gunichar)-1)
- {
- retval = FALSE;
- break;
- }
+ break;
p += len;
}
if (end)
*end = p;
-
- return retval;
+
+ /* See that we covered the entire length if a length was
+ * passed in, or that we ended on a nul if not
+ */
+ if (max_len >= 0 &&
+ p != (str + max_len))
+ return FALSE;
+ else if (max_len < 0 &&
+ *p != '\0')
+ return FALSE;
+ else
+ return TRUE;
}
diff --git a/gutf8.c b/gutf8.c
index 1f31f6e81..f79ab48e3 100644
--- a/gutf8.c
+++ b/gutf8.c
@@ -550,7 +550,6 @@ g_utf8_validate (const gchar *str,
{
const gchar *p;
- gboolean retval = TRUE;
if (end)
*end = str;
@@ -566,34 +565,35 @@ g_utf8_validate (const gchar *str,
UTF8_COMPUTE (c, mask, len);
if (len == -1)
- {
- retval = FALSE;
- break;
- }
+ break;
/* check that the expected number of bytes exists in str */
if (max_len >= 0 &&
((max_len - (p - str)) < len))
- {
- retval = FALSE;
- break;
- }
+ break;
UTF8_GET (result, p, i, mask, len);
if (result == (gunichar)-1)
- {
- retval = FALSE;
- break;
- }
+ break;
p += len;
}
if (end)
*end = p;
-
- return retval;
+
+ /* See that we covered the entire length if a length was
+ * passed in, or that we ended on a nul if not
+ */
+ if (max_len >= 0 &&
+ p != (str + max_len))
+ return FALSE;
+ else if (max_len < 0 &&
+ *p != '\0')
+ return FALSE;
+ else
+ return TRUE;
}