git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
421ca3f
)
Config lines are immutable during -bP config dump
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sun, 16 May 2021 11:52:36 +0000
(12:52 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sun, 27 Jun 2021 23:30:02 +0000
(
00:30
+0100)
src/src/readconf.c
patch
|
blob
|
history
diff --git
a/src/src/readconf.c
b/src/src/readconf.c
index 5d14be8111f4c2ba1a1e721e3bdc01bcaad77218..01e85a329f9a1b2265c2b22f35e394bf6c7a90e8 100644
(file)
--- a/
src/src/readconf.c
+++ b/
src/src/readconf.c
@@
-4419,25
+4419,28
@@
print_config(BOOL admin, BOOL terse)
{
const int TS = terse ? 0 : 2;
int indent = 0;
{
const int TS = terse ? 0 : 2;
int indent = 0;
+rmark r = NULL;
-for (config_line_item * i = config_lines; i; i = i->next)
+for (con
st con
fig_line_item * i = config_lines; i; i = i->next)
{
{
- uschar *current;
- uschar *p;
+ uschar * current, * p;
+
+ if (r) store_reset(r);
+ r = store_mark();
/* skip over to the first non-space */
/* skip over to the first non-space */
- for (current =
i->line
; *current && isspace(*current); ++current)
+ for (current =
string_copy(i->line)
; *current && isspace(*current); ++current)
;
;
- if (
*current == '\0'
)
+ if (
!*current
)
continue;
/* Collapse runs of spaces. We stop this if we encounter one of the
continue;
/* Collapse runs of spaces. We stop this if we encounter one of the
- * following characters: "'$, as this may indicate careful formatting */
- for (p = current; *p; ++p)
+ following characters: "'$, as this may indicate careful formatting */
+
+ for (p = current; *p; p++) if (isspace(*p))
{
uschar *next;
{
uschar *next;
- if (!isspace(*p)) continue;
if (*p != ' ') *p = ' ';
for (next = p; isspace(*next); ++next)
if (*p != ' ') *p = ' ';
for (next = p; isspace(*next); ++next)
@@
-4491,6
+4494,7
@@
for (config_line_item * i = config_lines; i; i = i->next)
/* rest is public */
printf("%*s%s\n", indent, "", current);
}
/* rest is public */
printf("%*s%s\n", indent, "", current);
}
+if (r) store_reset(r);
}
#endif /*!MACRO_PREDEF*/
}
#endif /*!MACRO_PREDEF*/