[glib/GVariantType] make g_variant_type_string_scan equal its docs
- From: Ryan Lortie <ryanl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glib/GVariantType] make g_variant_type_string_scan equal its docs
- Date: Sat, 23 Jan 2010 00:22:25 +0000 (UTC)
commit 3ba9988ce2459b0e01c08f127ec1cf2ffbf2f637
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Jan 22 19:19:37 2010 -0500
make g_variant_type_string_scan equal its docs
g_varant_type_string_scan had an unadvertised feature. remove it.
glib/gvarianttype.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c
index a8ef945..33281e2 100644
--- a/glib/gvarianttype.c
+++ b/glib/gvarianttype.c
@@ -585,11 +585,6 @@ g_variant_type_string_scan (const gchar *string,
if (endptr != NULL)
*endptr = string;
- else
- {
- if (string != limit && *string != '\0')
- return FALSE;
- }
return TRUE;
}
@@ -608,12 +603,14 @@ g_variant_type_string_scan (const gchar *string,
gboolean
g_variant_type_string_is_valid (const gchar *type_string)
{
+ gchar *endptr;
+
g_return_val_if_fail (type_string != NULL, FALSE);
- if (!g_variant_type_string_scan (type_string, NULL, NULL))
+ if (!g_variant_type_string_scan (type_string, NULL, &endptr))
return FALSE;
- return TRUE;
+ return *endptr == '\0';
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]