git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename EXPERIMENTAL_SRS to EXPERIMENTAL_SRS_ALT
[exim.git]
/
src
/
src
/
filter.c
diff --git
a/src/src/filter.c
b/src/src/filter.c
index 3da616700a2259c640b9ea83500f844575f1339a..402ad6ae53f52065f4e7df29b0f164ce2f67cc26 100644
(file)
--- a/
src/src/filter.c
+++ b/
src/src/filter.c
@@
-3,6
+3,7
@@
*************************************************/
/* Copyright (c) University of Cambridge 1995 - 2018 */
*************************************************/
/* Copyright (c) University of Cambridge 1995 - 2018 */
+/* Copyright (c) The Exim Maintainers 2020 */
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
@@
-1510,7
+1511,7
@@
switch (c->type)
parse_extract_address(pp, &error, &start, &end, &domain, FALSE);
*p = saveend;
parse_extract_address(pp, &error, &start, &end, &domain, FALSE);
*p = saveend;
- if (filter_thisaddress
!= NULL
)
+ if (filter_thisaddress)
{
if ((filter_test != FTEST_NONE && debug_selector != 0) ||
(debug_selector & D_filter) != 0)
{
if ((filter_test != FTEST_NONE && debug_selector != 0) ||
(debug_selector & D_filter) != 0)
@@
-1595,11
+1596,9
@@
switch (c->type)
debug_printf_indent(" Pattern = %s\n", exp[1]);
}
debug_printf_indent(" Pattern = %s\n", exp[1]);
}
- re = pcre_compile(CS exp[1],
+
if (!(
re = pcre_compile(CS exp[1],
PCRE_COPT | ((c->type == cond_matches)? PCRE_CASELESS : 0),
PCRE_COPT | ((c->type == cond_matches)? PCRE_CASELESS : 0),
- (const char **)®comp_error, ®comp_error_offset, NULL);
-
- if (re == NULL)
+ CCSS ®comp_error, ®comp_error_offset, NULL)))
{
*error_pointer = string_sprintf("error while compiling "
"regular expression \"%s\": %s at offset %d",
{
*error_pointer = string_sprintf("error while compiling "
"regular expression \"%s\": %s at offset %d",
@@
-1749,11
+1748,11
@@
while (commands)
uschar *error;
uschar *ss = parse_extract_address(s, &error, &start, &end, &domain,
FALSE);
uschar *error;
uschar *ss = parse_extract_address(s, &error, &start, &end, &domain,
FALSE);
- if (ss
!= NULL
)
- expargs[i] =
((filter_options & RDO_REWRITE) != 0)?
- rewrite_address(ss, TRUE, FALSE, global_rewrite_rules,
- rewrite_existflags) :
- rewrite_address_qualify(ss, TRUE);
+ if (ss)
+ expargs[i] =
filter_options & RDO_REWRITE
+
?
rewrite_address(ss, TRUE, FALSE, global_rewrite_rules,
+ rewrite_existflags)
+
:
rewrite_address_qualify(ss, TRUE);
else
{
*error_pointer = string_sprintf("malformed address \"%s\" in "
else
{
*error_pointer = string_sprintf("malformed address \"%s\" in "
@@
-2388,12
+2387,11
@@
Previously the test was for "auto-". */
for (h = header_list; h; h = h->next)
{
for (h = header_list; h; h = h->next)
{
- uschar *s;
if (h->type == htype_old) continue;
if (strncmpic(h->text, US"List-", 5) == 0)
{
if (h->type == htype_old) continue;
if (strncmpic(h->text, US"List-", 5) == 0)
{
- s = h->text + 5;
+
uschar *
s = h->text + 5;
if (strncmpic(s, US"Id:", 3) == 0 ||
strncmpic(s, US"Help:", 5) == 0 ||
strncmpic(s, US"Subscribe:", 10) == 0 ||
if (strncmpic(s, US"Id:", 3) == 0 ||
strncmpic(s, US"Help:", 5) == 0 ||
strncmpic(s, US"Subscribe:", 10) == 0 ||
@@
-2406,12
+2404,12
@@
for (h = header_list; h; h = h->next)
else if (strncmpic(h->text, US"Auto-submitted:", 15) == 0)
{
else if (strncmpic(h->text, US"Auto-submitted:", 15) == 0)
{
- s = h->text + 15;
-
while (isspace(*s)) s++
;
+
uschar *
s = h->text + 15;
+
Uskip_whitespace(&s)
;
if (strncmpic(s, US"no", 2) != 0) return FALSE;
s += 2;
if (strncmpic(s, US"no", 2) != 0) return FALSE;
s += 2;
-
while (isspace(*s)) s++
;
- if (*s
!= 0
) return FALSE;
+
Uskip_whitespace(&s)
;
+ if (*s) return FALSE;
}
}
}
}
@@
-2424,18
+2422,18
@@
self_to = rewrite_one(self, rewrite_to, NULL, FALSE, US"",
global_rewrite_rules);
global_rewrite_rules);
-if (
self_from == NULL
) self_from = self;
-if (self_to
== NULL
) self_to = self;
+if (
!self_from
) self_from = self;
+if (self_to) self_to = self;
/* If there's a prefix or suffix set, we must include the prefixed/
suffixed version of the local part in the tests. */
/* If there's a prefix or suffix set, we must include the prefixed/
suffixed version of the local part in the tests. */
-if (deliver_localpart_prefix
!= NULL || deliver_localpart_suffix != NULL
)
+if (deliver_localpart_prefix
|| deliver_localpart_suffix
)
{
psself = string_sprintf("%s%s%s@%s",
{
psself = string_sprintf("%s%s%s@%s",
-
(deliver_localpart_prefix == NULL)? US"" : deliver_localpart_prefix
,
+
deliver_localpart_prefix ? deliver_localpart_prefix : US""
,
deliver_localpart,
deliver_localpart,
-
(deliver_localpart_suffix == NULL)? US"" : deliver_localpart_suffix
,
+
deliver_localpart_suffix ? deliver_localpart_suffix : US""
,
deliver_domain);
psself_from = rewrite_one(psself, rewrite_from, NULL, FALSE, US"",
global_rewrite_rules);
deliver_domain);
psself_from = rewrite_one(psself, rewrite_from, NULL, FALSE, US"",
global_rewrite_rules);