[glib] gsettings-tool: implement range-checking
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gsettings-tool: implement range-checking
- Date: Mon, 4 Oct 2010 07:44:11 +0000 (UTC)
commit 59bdba3cbb50274b906740d483f049cdc91eb928
Author: Ryan Lortie <desrt desrt ca>
Date: Mon Oct 4 03:40:22 2010 -0400
gsettings-tool: implement range-checking
Prevent assertion messages from spewing forth and also ensure that we
exit with an error status in the event that the value was out of range.
Bug #631264.
gio/gsettings-tool.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c
index e35dd37..c751eeb 100644
--- a/gio/gsettings-tool.c
+++ b/gio/gsettings-tool.c
@@ -293,6 +293,13 @@ gsettings_set (GSettings *settings,
exit (1);
}
+ if (!g_settings_range_check (settings, key, new))
+ {
+ g_printerr ("The provided value is outside of the valid range\n");
+ g_variant_unref (new);
+ exit (1);
+ }
+
g_settings_set_value (settings, key, new);
g_variant_unref (existing);
g_variant_unref (new);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]