summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2015-11-13 10:51:00 +0100
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2015-11-13 10:51:00 +0100
commitce133ea613d35214340b24a8ef2097e00ddb3678 (patch)
tree8b30a80559e8bca5d431fc3ca0991e78543e6e7c
parent44f6c01d79710b030a8a73c25fe9620b41c8b0e4 (diff)
Hide hidden lines for -bP config
-rw-r--r--src/src/readconf.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 6767465a0..f127d5202 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -4246,7 +4246,8 @@ save_config_position(const uschar *file, int line)
/* Append a pre-parsed logical line to the config lines store,
this operates on a global (static) list that holds all the pre-parsed
-config lines */
+config lines, we do no further processing here, output formatting and
+honouring of <hide> or macros will be done during output */
static void
save_config_line(const uschar* line)
{
@@ -4309,20 +4310,23 @@ for (i = config_lines; i; i = i->next)
continue;
}
- /* as admin we don't care, as we do for "public" lines */
- if (admin || (!isupper(*current) && (strcmp(current, "hide") != 0)))
+ /* hidden lines (MACROS or prefixed with hide) */
+ if (!admin && (isupper(*current)
+ || (strncmp(current, "hide", 4) == 0 && isspace(current[4]))))
{
- printf("%*s%s\n", indent, "", current);
+ if (p = strchr(current, '='))
+ {
+ *p = '\0';
+ printf("%*s%s = %s\n", indent, "", current, hidden);
+ }
+ /* e.g.: hide split_spool_directory */
+ else printf("%*s\n", indent, hidden);
continue;
}
- /* hidden lines */
- if (p = strchr(current, '='))
- {
- *p = '\0';
- printf("%*s%s = %s\n", indent, "", current, hidden);
- continue;
- }
+ /* rest is public */
+ printf("%*s%s\n", indent, "", current);
+ continue;
}
}