X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Facl.c;h=d243ff4af6cd3d6e967fbfcbcde65dac975d1c9a;hb=54f3613c5c633833c34c54fbd143a77c7fd7aceb;hp=35d955da6a2c584f52cbac5ca66de755c59a8fa5;hpb=c679ee08b006c8fe4c62b353d909c992a725fc11;p=exim.git diff --git a/src/src/acl.c b/src/src/acl.c index 35d955da6..d243ff4af 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -1042,33 +1042,16 @@ uschar * fn_hdrs_added(void) { gstring * g = NULL; -header_line * h = acl_added_headers; -uschar * s; -uschar * cp; +header_line * h; -if (!h) return NULL; - -do +for (h = acl_added_headers; h; h = h->next) { - s = h->text; - while ((cp = Ustrchr(s, '\n')) != NULL) - { - if (cp[1] == '\0') break; - - /* contains embedded newline; needs doubling */ - g = string_catn(g, s, cp-s+1); - g = string_catn(g, US"\n", 1); - s = cp+1; - } - /* last bit of header */ - -/*XXX could we use add_listele? */ - g = string_catn(g, s, cp-s+1); /* newline-sep list */ + int i = h->slen; + if (h->text[i-1] == '\n') i--; + g = string_append_listele_n(g, '\n', h->text, i); } -while((h = h->next)); -g->s[g->ptr - 1] = '\0'; /* overwrite last newline */ -return g->s; +return g ? g->s : NULL; } @@ -2340,7 +2323,7 @@ if (leaky + strict + readonly > 1) return ratelimit_error(log_msgptr, "conflicting update modes"); if (badacl && (leaky || strict) && !noupdate) return ratelimit_error(log_msgptr, - "\"%s\" must not have /leaky or /strict option in %s ACL", + "\"%s\" must not have /leaky or /strict option, or cannot be used in %s ACL", ratelimit_option_string[mode], acl_wherenames[where]); /* Set the default values of any unset options. In readonly mode we @@ -2865,7 +2848,7 @@ int rc = OK; int sep = -'/'; #endif -for (; cb != NULL; cb = cb->next) +for (; cb; cb = cb->next) { const uschar *arg; int control_type;