From 805bc6ca2c2885b68b512ed641fa1cb62a3d4cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 31 May 2017 20:01:19 +0200 Subject: [PATCH] fset: use just "d" instead of "d:" to show changed options --- src/plugins/fset/fset-command.c | 2 +- src/plugins/fset/fset-option.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/fset/fset-command.c b/src/plugins/fset/fset-command.c index c03f148cc..3236a33b6 100644 --- a/src/plugins/fset/fset-command.c +++ b/src/plugins/fset/fset-command.c @@ -287,7 +287,7 @@ fset_command_init () " * show all options (no filter)\n" " f:xxx show only configuration file \"xxx\"\n" " s:xxx show only section \"xxx\"\n" - " d: show only changed options\n" + " d show only changed options\n" " d:xxx show only changed options with \"xxx\" in name\n" " d=xxx show only changed options with \"xxx\" in value\n" " d==xxx show only changed options with exact value \"xxx\"\n" diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c index d09e84e06..62aad7266 100644 --- a/src/plugins/fset/fset-option.c +++ b/src/plugins/fset/fset-option.c @@ -243,12 +243,13 @@ fset_option_match_filters (const char *config_name, const char *section_name, /* filter by modified values */ if (!fset_option_value_different_from_default (fset_option)) return 0; - if (fset_option_filter[2] - && !fset_option_string_match (fset_option->name, fset_option_filter + 2)) - { - return 0; - } - return 1; + return fset_option_string_match (fset_option->name, + fset_option_filter + 2) ? 1 : 0; + } + else if (strcmp (fset_option_filter, "d") == 0) + { + /* filter by modified values */ + return (fset_option_value_different_from_default (fset_option)) ? 1 : 0; } else if (strncmp (fset_option_filter, "==", 2) == 0) {