diff options
author | Nick Schermer <nick@xfce.org> | 2012-04-20 18:43:35 +0200 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2012-04-20 18:43:35 +0200 |
commit | 1407f1b1330e93de9defd44045304af6a53137c2 (patch) | |
tree | 5f742b38accea5aca05eac24b87c2e22e6ccfea9 | |
parent | 73662a19a92aa037f4f39f586e20b4042c2088ab (diff) | |
download | xfce4-appfinder-1407f1b1330e93de9defd44045304af6a53137c2.tar.gz |
Fix property-changed matching.
%s in scanf sucks since it continues even if the character
is not a digit anymore. Use %n to check the suffix.
-rw-r--r-- | src/appfinder-preferences.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/appfinder-preferences.c b/src/appfinder-preferences.c index 233aed1..becc111 100644 --- a/src/appfinder-preferences.c +++ b/src/appfinder-preferences.c @@ -392,6 +392,7 @@ xfce_appfinder_preferences_action_changed (XfconfChannel *channel, gint unique_id; GObject *store; UpdateContext context; + gint offset = 0; if (prop_name == NULL) return; @@ -400,8 +401,9 @@ xfce_appfinder_preferences_action_changed (XfconfChannel *channel, { xfce_appfinder_preferences_action_populate (preferences); } - else if (sscanf (prop_name, "/actions/action-%d/pattern", &unique_id) == 1 - && G_VALUE_HOLDS_STRING (value)) + else if (G_VALUE_HOLDS_STRING (value) + && sscanf (prop_name, "/actions/action-%d%n", &unique_id, &offset) == 1 + && g_strcmp0 (prop_name + offset, "/pattern") == 0) { context.unique_id = unique_id; context.value = value; |