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 (parent:
6641ba4
)
tidying: skip_whitespace
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 4 Apr 2020 13:25:07 +0000
(14:25 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 4 Apr 2020 13:27:57 +0000
(14:27 +0100)
18 files changed:
src/src/acl.c
patch
|
blob
|
history
src/src/exim.c
patch
|
blob
|
history
src/src/expand.c
patch
|
blob
|
history
src/src/filter.c
patch
|
blob
|
history
src/src/functions.h
patch
|
blob
|
history
src/src/globals.h
patch
|
blob
|
history
src/src/header.c
patch
|
blob
|
history
src/src/log.c
patch
|
blob
|
history
src/src/lookups/sqlite.c
patch
|
blob
|
history
src/src/match.c
patch
|
blob
|
history
src/src/moan.c
patch
|
blob
|
history
src/src/parse.c
patch
|
blob
|
history
src/src/rda.c
patch
|
blob
|
history
src/src/readconf.c
patch
|
blob
|
history
src/src/smtp_in.c
patch
|
blob
|
history
src/src/smtp_out.c
patch
|
blob
|
history
src/src/transports/appendfile.c
patch
|
blob
|
history
src/src/verify.c
patch
|
blob
|
history
diff --git
a/src/src/acl.c
b/src/src/acl.c
index 74ec1ef33f78f8702eed3f1bdc0348bef22ca8e2..9ed005781d7fa535a0cff0d628dcf8de38d0a3de 100644
(file)
--- a/
src/src/acl.c
+++ b/
src/src/acl.c
@@
-732,7
+732,7
@@
uschar * s;
*error = NULL;
*error = NULL;
-while ((s = (*func)())
!= NULL
)
+while ((s = (*func)()))
{
int v, c;
BOOL negated = FALSE;
{
int v, c;
BOOL negated = FALSE;
@@
-742,8
+742,7
@@
while ((s = (*func)()) != NULL)
/* Conditions (but not verbs) are allowed to be negated by an initial
exclamation mark. */
/* Conditions (but not verbs) are allowed to be negated by an initial
exclamation mark. */
- while (isspace(*s)) s++;
- if (*s == '!')
+ if (Uskip_whitespace(&s) == '!')
{
negated = TRUE;
s++;
{
negated = TRUE;
s++;
@@
-859,7
+858,7
@@
while ((s = (*func)()) != NULL)
}
cond->u.varname = string_copyn(s, 18);
s = endptr;
}
cond->u.varname = string_copyn(s, 18);
s = endptr;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
}
else
#endif
}
else
#endif
@@
-895,7
+894,7
@@
while ((s = (*func)()) != NULL)
cond->u.varname = string_copyn(s + 4, endptr - s - 4);
s = endptr;
cond->u.varname = string_copyn(s + 4, endptr - s - 4);
s = endptr;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
}
/* For "set", we are now positioned for the data. For the others, only
}
/* For "set", we are now positioned for the data. For the others, only
@@
-909,7
+908,7
@@
while ((s = (*func)()) != NULL)
conditions[c].is_modifier ? US"modifier" : US"condition");
return NULL;
}
conditions[c].is_modifier ? US"modifier" : US"condition");
return NULL;
}
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
cond->arg = string_copy(s);
}
}
cond->arg = string_copy(s);
}
}
@@
-3843,16
+3842,16
@@
uschar *yield;
for(;;)
{
for(;;)
{
-
while (isspace(*acl_text)) acl_text++;
/* Leading spaces/empty lines */
- if (
*acl_text == 0
) return NULL; /* No more data */
- yield = acl_text;
/* Potential data line */
+
Uskip_whitespace(&acl_text);
/* Leading spaces/empty lines */
+ if (
!*acl_text
) return NULL; /* No more data */
+ yield = acl_text; /* Potential data line */
while (*acl_text && *acl_text != '\n') acl_text++;
/* If we hit the end before a newline, we have the whole logical line. If
it's a comment, there's no more data to be given. Otherwise, yield it. */
while (*acl_text && *acl_text != '\n') acl_text++;
/* If we hit the end before a newline, we have the whole logical line. If
it's a comment, there's no more data to be given. Otherwise, yield it. */
- if (
*acl_text == 0) return (*yield == '#')
? NULL : yield;
+ if (
!*acl_text) return *yield == '#'
? NULL : yield;
/* After reaching a newline, end this loop if the physical line does not
start with '#'. If it does, it's a comment, and the loop continues. */
/* After reaching a newline, end this loop if the physical line does not
start with '#'. If it does, it's a comment, and the loop continues. */
diff --git
a/src/src/exim.c
b/src/src/exim.c
index 10526ba5f6c0c2745b49edc148c205fc145ba9c8..bb49ee670b0c31e4fda32fdbe46dde2ecf26f588 100644
(file)
--- a/
src/src/exim.c
+++ b/
src/src/exim.c
@@
-1629,7
+1629,6
@@
uschar *malware_test_file = NULL;
uschar *real_sender_address;
uschar *originator_home = US"/";
size_t sz;
uschar *real_sender_address;
uschar *originator_home = US"/";
size_t sz;
-rmark reset_point;
struct passwd *pw;
struct stat statbuf;
struct passwd *pw;
struct stat statbuf;
@@
-1948,11
+1947,16
@@
running in an unprivileged state. */
unprivileged = (real_uid != root_uid && original_euid != root_uid);
unprivileged = (real_uid != root_uid && original_euid != root_uid);
+/* For most of the args-parsing we need to use permanent pool memory */
+ {
+ int old_pool = store_pool;
+ store_pool = POOL_PERM;
+
/* Scan the program's arguments. Some can be dealt with right away; others are
simply recorded for checking and handling afterwards. Do a high-level switch
on the second character (the one after '-'), to save some effort. */
/* Scan the program's arguments. Some can be dealt with right away; others are
simply recorded for checking and handling afterwards. Do a high-level switch
on the second character (the one after '-'), to save some effort. */
-for (i = 1; i < argc; i++)
+
for (i = 1; i < argc; i++)
{
BOOL badarg = FALSE;
uschar * arg = argv[i];
{
BOOL badarg = FALSE;
uschar * arg = argv[i];
@@
-2401,11
+2405,14
@@
for (i = 1; i < argc; i++)
else
{
/* Well, the trust list at least is up to scratch... */
else
{
/* Well, the trust list at least is up to scratch... */
- rmark reset_point
= store_mark()
;
+ rmark reset_point;
uschar *trusted_configs[32];
int nr_configs = 0;
int i = 0;
uschar *trusted_configs[32];
int nr_configs = 0;
int i = 0;
+ int old_pool = store_pool;
+ store_pool = POOL_MAIN;
+ reset_point = store_mark();
while (Ufgets(big_buffer, big_buffer_size, trust_list))
{
uschar *start = big_buffer, *nl;
while (Ufgets(big_buffer, big_buffer_size, trust_list))
{
uschar *start = big_buffer, *nl;
@@
-2443,6
+2450,7
@@
for (i = 1; i < argc; i++)
else /* No valid prefixes found in trust_list file. */
f.trusted_config = FALSE;
store_reset(reset_point);
else /* No valid prefixes found in trust_list file. */
f.trusted_config = FALSE;
store_reset(reset_point);
+ store_pool = old_pool;
}
}
else /* Could not open trust_list file. */
}
}
else /* Could not open trust_list file. */
@@
-3210,20
+3218,16
@@
for (i = 1; i < argc; i++)
if (*argrest)
{
if (*argrest)
{
- uschar *
hn
;
+ uschar *
hn = Ustrchr(argrest, ':')
;
if (received_protocol)
exim_fail("received_protocol is set already\n");
if (received_protocol)
exim_fail("received_protocol is set already\n");
- hn = Ustrchr(argrest, ':');
if (!hn)
received_protocol = string_copy_taint(argrest, TRUE);
else
{
if (!hn)
received_protocol = string_copy_taint(argrest, TRUE);
else
{
- int old_pool = store_pool;
- store_pool = POOL_PERM;
received_protocol = string_copyn_taint(argrest, hn - argrest, TRUE);
received_protocol = string_copyn_taint(argrest, hn - argrest, TRUE);
- store_pool = old_pool;
sender_host_name = string_copy_taint(hn + 1, TRUE);
}
}
sender_host_name = string_copy_taint(hn + 1, TRUE);
}
}
@@
-3482,12
+3486,15
@@
for (i = 1; i < argc; i++)
/* If -R or -S have been specified without -q, assume a single queue run. */
/* If -R or -S have been specified without -q, assume a single queue run. */
-if ( (deliver_selectstring || deliver_selectstring_sender)
- && queue_interval < 0)
-
queue_interval = 0;
+
if ( (deliver_selectstring || deliver_selectstring_sender)
+
&& queue_interval < 0)
+ queue_interval = 0;
END_ARG:
END_ARG:
+ store_pool = old_pool;
+ }
+
/* If usage_wanted is set we call the usage function - which never returns */
if (usage_wanted) exim_usage(called_as);
/* If usage_wanted is set we call the usage function - which never returns */
if (usage_wanted) exim_usage(called_as);
@@
-5088,6
+5095,7
@@
if (host_checking)
if (smtp_start_session())
{
if (smtp_start_session())
{
+ rmark reset_point;
for (; (reset_point = store_mark()); store_reset(reset_point))
{
if (smtp_setup_msg() <= 0) break;
for (; (reset_point = store_mark()); store_reset(reset_point))
{
if (smtp_setup_msg() <= 0) break;
@@
-5339,7
+5347,7
@@
collapsed). */
while (more)
{
while (more)
{
- reset_point = store_mark();
+ r
mark r
eset_point = store_mark();
message_id[0] = 0;
/* Handle the SMTP case; call smtp_setup_mst() to deal with the initial SMTP
message_id[0] = 0;
/* Handle the SMTP case; call smtp_setup_mst() to deal with the initial SMTP
diff --git
a/src/src/expand.c
b/src/src/expand.c
index de53fe41160f9f3c3cb9e0916c8e647d0c1811dd..789f09907f074e27ff65984337a56ef6f8665fc4 100644
(file)
--- a/
src/src/expand.c
+++ b/
src/src/expand.c
@@
-1174,7
+1174,7
@@
static uschar *
expand_getkeyed(uschar * key, const uschar * s)
{
int length = Ustrlen(key);
expand_getkeyed(uschar * key, const uschar * s)
{
int length = Ustrlen(key);
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
/* Loop to search for the key */
/* Loop to search for the key */
@@
-1186,14
+1186,13
@@
while (*s)
while (*s && *s != '=' && !isspace(*s)) s++;
dkeylength = s - dkey;
while (*s && *s != '=' && !isspace(*s)) s++;
dkeylength = s - dkey;
- while (isspace(*s)) s++;
- if (*s == '=') while (isspace((*(++s))));
+ if (Uskip_whitespace(&s) == '=') while (isspace((*(++s))));
data = string_dequote(&s);
if (length == dkeylength && strncmpic(key, dkey, length) == 0)
return data;
data = string_dequote(&s);
if (length == dkeylength && strncmpic(key, dkey, length) == 0)
return data;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
}
return NULL;
}
return NULL;
@@
-2044,7
+2043,7
@@
switch (vp->type)
s = find_header(US"reply-to:", newsize,
exists_only ? FH_EXISTS_ONLY|FH_WANT_RAW : FH_WANT_RAW,
headers_charset);
s = find_header(US"reply-to:", newsize,
exists_only ? FH_EXISTS_ONLY|FH_WANT_RAW : FH_WANT_RAW,
headers_charset);
- if (s)
while (isspace(*s)) s++
;
+ if (s)
Uskip_whitespace(&s)
;
if (!s || !*s)
{
*newsize = 0; /* For the *s==0 case */
if (!s || !*s)
{
*newsize = 0; /* For the *s==0 case */
@@
-2055,8
+2054,8
@@
switch (vp->type)
if (s)
{
uschar *t;
if (s)
{
uschar *t;
-
while (isspace(*s)) s++
;
- for (t = s; *t
!= 0
; t++) if (*t == '\n') *t = ' ';
+
Uskip_whitespace(&s)
;
+ for (t = s; *t; t++) if (*t == '\n') *t = ' ';
while (t > s && isspace(t[-1])) t--;
*t = 0;
}
while (t > s && isspace(t[-1])) t--;
*t = 0;
}
@@
-2144,7
+2143,7
@@
read_subs(uschar **sub, int n, int m, const uschar **sptr, BOOL skipping,
{
const uschar *s = *sptr;
{
const uschar *s = *sptr;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
for (int i = 0; i < n; i++)
{
if (*s != '{')
for (int i = 0; i < n; i++)
{
if (*s != '{')
@@
-2161,7
+2160,7
@@
for (int i = 0; i < n; i++)
if (!(sub[i] = expand_string_internal(s+1, TRUE, &s, skipping, TRUE, resetok)))
return 3;
if (*s++ != '}') return 1;
if (!(sub[i] = expand_string_internal(s+1, TRUE, &s, skipping, TRUE, resetok)))
return 3;
if (*s++ != '}') return 1;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
}
if (check_end && *s++ != '}')
{
}
if (check_end && *s++ != '}')
{
@@
-2284,9
+2283,7
@@
uschar * p = s;
unsigned depth = 0;
BOOL quotesmode = wrap[0] == wrap[1];
unsigned depth = 0;
BOOL quotesmode = wrap[0] == wrap[1];
-while (isspace(*p)) p++;
-
-if (*p == *wrap)
+if (Uskip_whitespace(&p) == *wrap)
{
s = ++p;
wrap++;
{
s = ++p;
wrap++;
@@
-4026,8
+4023,7
@@
int c;
int_eximarith_t n;
uschar *s = *sptr;
int_eximarith_t n;
uschar *s = *sptr;
-while (isspace(*s)) s++;
-if (isdigit((c = *s)))
+if (isdigit((c = Uskip_whitespace(&s))))
{
int count;
(void)sscanf(CS s, (decimal? SC_EXIM_DEC "%n" : SC_EXIM_ARITH "%n"), &n, &count);
{
int count;
(void)sscanf(CS s, (decimal? SC_EXIM_DEC "%n" : SC_EXIM_ARITH "%n"), &n, &count);
@@
-4039,7
+4035,7
@@
if (isdigit((c = *s)))
case 'm': n *= 1024*1024; s++; break;
case 'g': n *= 1024*1024*1024; s++; break;
}
case 'm': n *= 1024*1024; s++; break;
case 'g': n *= 1024*1024*1024; s++; break;
}
-
while (isspace (*s)) s++
;
+
Uskip_whitespace(&s)
;
}
else if (c == '(')
{
}
else if (c == '(')
{
@@
-4061,7
+4057,7
@@
eval_op_unary(uschar **sptr, BOOL decimal, uschar **error)
{
uschar *s = *sptr;
int_eximarith_t x;
{
uschar *s = *sptr;
int_eximarith_t x;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
if (*s == '+' || *s == '-' || *s == '~')
{
int op = *s++;
if (*s == '+' || *s == '-' || *s == '~')
{
int op = *s++;
@@
-4819,12
+4815,12
@@
while (*s != 0)
kinds. Allow everything except space or { to appear; the actual content
is checked by search_findtype_partial. */ /*}*/
kinds. Allow everything except space or { to appear; the actual content
is checked by search_findtype_partial. */ /*}*/
- while (*s
!= 0 && *s != '{' && !isspace(*s))
/*}*/
+ while (*s
&& *s != '{' && !isspace(*s))
/*}*/
{
if (nameptr < sizeof(name) - 1) name[nameptr++] = *s;
s++;
}
{
if (nameptr < sizeof(name) - 1) name[nameptr++] = *s;
s++;
}
- name[nameptr] =
0
;
+ name[nameptr] =
'\0'
;
while (isspace(*s)) s++;
/* Now check for the individual search type and any partial or default
while (isspace(*s)) s++;
/* Now check for the individual search type and any partial or default
diff --git
a/src/src/filter.c
b/src/src/filter.c
index 90e83e6b0608ee8cba8c640226b7bbb8f69b6adb..c5081698f33533e205eead4f27a364b87b9d977a 100644
(file)
--- a/
src/src/filter.c
+++ b/
src/src/filter.c
@@
-2386,12
+2386,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 ||
@@
-2404,12
+2403,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;
}
}
}
}
@@
-2422,13
+2421,13
@@
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",
(deliver_localpart_prefix == NULL)? US"" : deliver_localpart_prefix,
{
psself = string_sprintf("%s%s%s@%s",
(deliver_localpart_prefix == NULL)? US"" : deliver_localpart_prefix,
diff --git
a/src/src/functions.h
b/src/src/functions.h
index f3877563db67ce3bd9a661a79b2ed66f7ac35f06..28d6f26a66c7d0a83bf1b6fbda26607ff75e03f8 100644
(file)
--- a/
src/src/functions.h
+++ b/
src/src/functions.h
@@
-13,6
+13,7
@@
are in in fact in separate headers. */
#ifndef _FUNCTIONS_H_
#define _FUNCTIONS_H_
#ifndef _FUNCTIONS_H_
#define _FUNCTIONS_H_
+#include <ctype.h>
#include <sys/time.h>
#include <sys/time.h>
@@
-666,6
+667,15
@@
return US strncpy(CS dst, CCS src, n);
/*XXX will likely need unchecked copy also */
/*XXX will likely need unchecked copy also */
+/* Advance the string pointer given over any whitespace.
+Return the next char as there's enought places using it to be useful. */
+
+#define Uskip_whitespace(sp) skip_whitespace(CUSS sp)
+
+static inline uschar skip_whitespace(const uschar ** sp)
+{ while (isspace(**sp)) (*sp)++; return **sp; }
+
+
/******************************************************************************/
#if !defined(MACRO_PREDEF) && !defined(COMPILE_UTILITY)
/******************************************************************************/
#if !defined(MACRO_PREDEF) && !defined(COMPILE_UTILITY)
diff --git
a/src/src/globals.h
b/src/src/globals.h
index 882f289d778ee6bdc491665b397fb9628c4ca1fb..b46e20be48a9f5424c92e16342bffa6ab6d8917c 100644
(file)
--- a/
src/src/globals.h
+++ b/
src/src/globals.h
@@
-344,7
+344,7
@@
extern gid_t *admin_groups; /* List of admin groups */
extern BOOL allow_domain_literals; /* As it says */
extern BOOL allow_mx_to_ip; /* Allow MX records to -> ip address */
#ifdef EXPERIMENTAL_ARC
extern BOOL allow_domain_literals; /* As it says */
extern BOOL allow_mx_to_ip; /* Allow MX records to -> ip address */
#ifdef EXPERIMENTAL_ARC
-
struct arc_set *arc_received;
/* highest ARC instance evaluation struct */
+
extern struct arc_set *arc_received;
/* highest ARC instance evaluation struct */
extern int arc_received_instance; /* highest ARC instance number in headers */
extern int arc_oldest_pass; /* lowest passing instance number in headers */
extern const uschar *arc_state; /* verification state */
extern int arc_received_instance; /* highest ARC instance number in headers */
extern int arc_oldest_pass; /* lowest passing instance number in headers */
extern const uschar *arc_state; /* verification state */
diff --git
a/src/src/header.c
b/src/src/header.c
index cbfc4f847e5a5ce28062f912e2d514c5b88074dc..857351972a49736afa580af812cbe3891c010bf8 100644
(file)
--- a/
src/src/header.c
+++ b/
src/src/header.c
@@
-321,9
+321,8
@@
while (bot < top)
if (c == 0)
{
if (c == 0)
{
- uschar *s = text + mid->len;
- while (isspace(*s)) s++;
- if (*s == ':')
+ uschar * s = text + mid->len;
+ if (Uskip_whitespace(&s) == ':')
return (!is_resent || mid->allow_resent)? mid->htype : htype_other;
c = 1;
}
return (!is_resent || mid->allow_resent)? mid->htype : htype_other;
c = 1;
}
diff --git
a/src/src/log.c
b/src/src/log.c
index d9cf23a40d3b91c6cb3eb81d868c0751a9622163..5fa0017eb0cb901666f0029440f536620faf11c2 100644
(file)
--- a/
src/src/log.c
+++ b/
src/src/log.c
@@
-1298,14
+1298,14
@@
decode_bits(unsigned int *selector, size_t selsize, int *notall,
uschar *string, bit_table *options, int count, uschar *which, int flags)
{
uschar *errmsg;
uschar *string, bit_table *options, int count, uschar *which, int flags)
{
uschar *errmsg;
-if (
string == NULL
) return;
+if (
!string
) return;
if (*string == '=')
{
char *end; /* Not uschar */
memset(selector, 0, sizeof(*selector)*selsize);
*selector = strtoul(CS string+1, &end, 0);
if (*string == '=')
{
char *end; /* Not uschar */
memset(selector, 0, sizeof(*selector)*selsize);
*selector = strtoul(CS string+1, &end, 0);
- if (
*end == 0
) return;
+ if (
!*end
) return;
errmsg = string_sprintf("malformed numeric %s_selector setting: %s", which,
string);
goto ERROR_RETURN;
errmsg = string_sprintf("malformed numeric %s_selector setting: %s", which,
string);
goto ERROR_RETURN;
@@
-1320,8
+1320,8
@@
else for(;;)
int len;
bit_table *start, *end;
int len;
bit_table *start, *end;
-
while (isspace(*string)) string++
;
- if (
*string == 0
) return;
+
Uskip_whitespace(&string)
;
+ if (
!*string
) return;
if (*string != '+' && *string != '-')
{
if (*string != '+' && *string != '-')
{
@@
-1343,7
+1343,6
@@
else for(;;)
bit_table *middle = start + (end - start)/2;
int c = Ustrncmp(s, middle->name, len);
if (c == 0)
bit_table *middle = start + (end - start)/2;
int c = Ustrncmp(s, middle->name, len);
if (c == 0)
- {
if (middle->name[len] != 0) c = -1; else
{
unsigned int bit = middle->bit;
if (middle->name[len] != 0) c = -1; else
{
unsigned int bit = middle->bit;
@@
-1365,7
+1364,6
@@
else for(;;)
break; /* Out of loop to match selector name */
}
break; /* Out of loop to match selector name */
}
- }
if (c < 0) end = middle; else start = middle + 1;
} /* Loop to match selector name */
if (c < 0) end = middle; else start = middle + 1;
} /* Loop to match selector name */
diff --git
a/src/src/lookups/sqlite.c
b/src/src/lookups/sqlite.c
index a7cca541985427da863dc7ddd83ad5eb0cc1aa8b..deb3b4eeefb4b89eb55f8be9d0362479c6dd471b 100644
(file)
--- a/
src/src/lookups/sqlite.c
+++ b/
src/src/lookups/sqlite.c
@@
-79,7
+79,7
@@
sqlite_find(void * handle, const uschar * filename, const uschar * query,
int ret;
gstring * res = NULL;
int ret;
gstring * res = NULL;
-ret = sqlite3_exec(handle, CS query, sqlite_callback, &res,
(char **)
errmsg);
+ret = sqlite3_exec(handle, CS query, sqlite_callback, &res,
CSS
errmsg);
if (ret != SQLITE_OK)
{
debug_printf_indent("sqlite3_exec failed: %s\n", *errmsg);
if (ret != SQLITE_OK)
{
debug_printf_indent("sqlite3_exec failed: %s\n", *errmsg);
diff --git
a/src/src/match.c
b/src/src/match.c
index 2ad28a95c1aa3ea1724f503d4f25da72c56c9dd4..a0899bf3eef8f9e0e6ae751955821838556e36ac 100644
(file)
--- a/
src/src/match.c
+++ b/
src/src/match.c
@@
-276,14
+276,14
@@
if (!cb->use_partial) partial = -1;
/* Set the parameters for the three different kinds of lookup. */
keyquery = semicolon + 1;
/* Set the parameters for the three different kinds of lookup. */
keyquery = semicolon + 1;
-
while (isspace(*keyquery)) keyquery++
;
+
Uskip_whitespace(&keyquery)
;
if (mac_islookup(search_type, lookup_absfilequery))
{
filename = keyquery;
if (mac_islookup(search_type, lookup_absfilequery))
{
filename = keyquery;
- while (*keyquery
!= 0
&& !isspace(*keyquery)) keyquery++;
+ while (*keyquery && !isspace(*keyquery)) keyquery++;
filename = string_copyn(filename, keyquery - filename);
filename = string_copyn(filename, keyquery - filename);
-
while (isspace(*keyquery)) keyquery++
;
+
Uskip_whitespace(&keyquery)
;
}
else if (!mac_islookup(search_type, lookup_querystyle))
}
else if (!mac_islookup(search_type, lookup_querystyle))
@@
-301,7
+301,7
@@
if (!(handle = search_open(filename, search_type, 0, NULL, NULL)))
result = search_find(handle, filename, keyquery, partial, affix, affixlen,
starflags, &expand_setup, opts);
result = search_find(handle, filename, keyquery, partial, affix, affixlen,
starflags, &expand_setup, opts);
-if (!result) return f.search_find_defer? DEFER : FAIL;
+if (!result) return f.search_find_defer
? DEFER : FAIL;
if (valueptr) *valueptr = result;
expand_nmax = expand_setup;
if (valueptr) *valueptr = result;
expand_nmax = expand_setup;
diff --git
a/src/src/moan.c
b/src/src/moan.c
index 48d4f905efcf08098a012763e52b30c294d481f7..7d49c4cb1fb6e9a110b7462e039f9370a7c549ae 100644
(file)
--- a/
src/src/moan.c
+++ b/
src/src/moan.c
@@
-63,7
+63,7
@@
if (!message_id)
if (h->type == htype_id)
{
message_id = Ustrchr(h->text, ':') + 1;
if (h->type == htype_id)
{
message_id = Ustrchr(h->text, ':') + 1;
-
while (isspace(*message_id)) message_id++
;
+
Uskip_whitespace(&message_id)
;
}
for (h = header_list; h; h = h->next)
}
for (h = header_list; h; h = h->next)
diff --git
a/src/src/parse.c
b/src/src/parse.c
index 5d50d6862181876289bec20ebcf38b5c642abaca..9bc76c3c6a4058ef1c4a15fbbee8841d63df7d99 100644
(file)
--- a/
src/src/parse.c
+++ b/
src/src/parse.c
@@
-197,10
+197,10
@@
last_comment_position = s;
while (*s)
{
int c, level;
while (*s)
{
int c, level;
- while (isspace(*s)) s++;
- if (
*s
!= '(') break;
+
+ if (
Uskip_whitespace(&s)
!= '(') break;
level = 1;
level = 1;
- while((c = *(++s))
!= 0
)
+ while((c = *(++s)))
{
if (c == '(') level++;
else if (c == ')') { if (--level <= 0) { s++; break; } }
{
if (c == '(') level++;
else if (c == ')') { if (--level <= 0) { s++; break; } }
@@
-2190,7
+2190,7
@@
while (Ufgets(buffer, sizeof(buffer), stdin) != NULL)
}
s = ss + (terminator? 1:0);
}
s = ss + (terminator? 1:0);
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
}
}
}
}
diff --git
a/src/src/rda.c
b/src/src/rda.c
index 0dc859107746cb6d8911ed8c65bcfb26fd612f67..aed8abc246b54b5e1a764f0e13171c827f958542 100644
(file)
--- a/
src/src/rda.c
+++ b/
src/src/rda.c
@@
-42,7
+42,7
@@
Returns: FILTER_EXIM if it starts with "# Exim filter"
static BOOL
match_tag(const uschar *s, const uschar *tag)
{
static BOOL
match_tag(const uschar *s, const uschar *tag)
{
-for (; *tag
!= 0
; s++, tag++)
+for (; *tag; s++, tag++)
if (*tag == ' ')
{
while (*s == ' ' || *s == '\t') s++;
if (*tag == ' ')
{
while (*s == ' ' || *s == '\t') s++;
@@
-60,10
+60,10
@@
tags for other types of filter. */
int
rda_is_filter(const uschar *s)
{
int
rda_is_filter(const uschar *s)
{
-
while (isspace(*s)) s++;
/* Skips initial blank lines */
-if (match_tag(s, CUS"# exim filter")) return FILTER_EXIM;
-
else if (match_tag(s, CUS"# sieve filter"))
return FILTER_SIEVE;
-
else
return FILTER_FORWARD;
+
Uskip_whitespace(&s);
/* Skips initial blank lines */
+if (match_tag(s, CUS"# exim filter"))
return FILTER_EXIM;
+
else if (match_tag(s, CUS"# sieve filter"))
return FILTER_SIEVE;
+
else
return FILTER_FORWARD;
}
}
diff --git
a/src/src/readconf.c
b/src/src/readconf.c
index 2bf1e63d6970359112a2bde0767d143d2f0d71f9..04b3e1161966e3c734a67842b199d28807ad5fe3 100644
(file)
--- a/
src/src/readconf.c
+++ b/
src/src/readconf.c
@@
-692,7
+692,7
@@
while (isalnum(*s) || *s == '_')
}
name[namelen] = 0;
}
name[namelen] = 0;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
if (*s++ != '=')
{
log_write(0, LOG_PANIC|LOG_CONFIG_IN, "malformed macro definition");
if (*s++ != '=')
{
log_write(0, LOG_PANIC|LOG_CONFIG_IN, "malformed macro definition");
@@
-704,7
+704,7
@@
if (*s == '=')
redef = TRUE;
s++;
}
redef = TRUE;
s++;
}
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
/* If an existing macro of the same name was defined on the command line, we
just skip this definition. It's an error to attempt to redefine a macro without
/* If an existing macro of the same name was defined on the command line, we
just skip this definition. It's an error to attempt to redefine a macro without
@@
-796,7
+796,7
@@
uschar * s;
/* Find the true start of the physical line - leading spaces are always
ignored. */
/* Find the true start of the physical line - leading spaces are always
ignored. */
-
while (isspace(*ss)) ss++
;
+
Uskip_whitespace(&ss)
;
/* Process the physical line for macros. If this is the start of the logical
line, skip over initial text at the start of the line if it starts with an
/* Process the physical line for macros. If this is the start of the logical
line, skip over initial text at the start of the line if it starts with an
@@
-808,8
+808,7
@@
s = ss;
if (len == 0 && isupper(*s))
{
while (isalnum(*s) || *s == '_') s++;
if (len == 0 && isupper(*s))
{
while (isalnum(*s) || *s == '_') s++;
- while (isspace(*s)) s++;
- if (*s != '=') s = ss; /* Not a macro definition */
+ if (Uskip_whitespace(&s) != '=') s = ss; /* Not a macro definition */
}
/* Skip leading chars which cannot start a macro name, to avoid multiple
}
/* Skip leading chars which cannot start a macro name, to avoid multiple
@@
-872,7
+871,7
@@
if (*s) for (macro_item * m = *s == '_' ? macros : macros_user; m; m = m->next)
/* An empty macro replacement at the start of a line could mean that ss no
longer points to the first non-blank character. */
/* An empty macro replacement at the start of a line could mean that ss no
longer points to the first non-blank character. */
-
while (isspace(*ss)) ss++
;
+
Uskip_whitespace(&ss)
;
return ss;
}
return ss;
}
@@
-1045,7
+1044,7
@@
for (;;)
struct stat statbuf;
ss += 9 + include_if_exists;
struct stat statbuf;
ss += 9 + include_if_exists;
-
while (isspace(*ss)) ss++
;
+
Uskip_whitespace(&ss)
;
t = ss + Ustrlen(ss);
while (t > ss && isspace(t[-1])) t--;
if (*ss == '\"' && t[-1] == '\"')
t = ss + Ustrlen(ss);
while (t > ss && isspace(t[-1])) t--;
if (*ss == '\"' && t[-1] == '\"')
@@
-1136,7
+1135,7
@@
if (config_lines)
if (strncmpic(s, US"begin ", 6) == 0)
{
s += 6;
if (strncmpic(s, US"begin ", 6) == 0)
{
s += 6;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
if (big_buffer + len - s > sizeof(next_section) - 2)
s[sizeof(next_section) - 2] = 0;
Ustrcpy(next_section, s);
if (big_buffer + len - s > sizeof(next_section) - 2)
s[sizeof(next_section) - 2] = 0;
Ustrcpy(next_section, s);
@@
-1170,17
+1169,16
@@
uschar *
readconf_readname(uschar *name, int len, uschar *s)
{
int p = 0;
readconf_readname(uschar *name, int len, uschar *s)
{
int p = 0;
-while (isspace(*s)) s++;
-if (isalpha(*s))
- {
+
+if (isalpha(Uskip_whitespace(&s)))
while (isalnum(*s) || *s == '_')
{
if (p < len-1) name[p++] = *s;
s++;
}
while (isalnum(*s) || *s == '_')
{
if (p < len-1) name[p++] = *s;
s++;
}
- }
+
name[p] = 0;
name[p] = 0;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
return s;
}
return s;
}
@@
-1416,15
+1414,15
@@
rewrite_rule *next = store_get(sizeof(rewrite_rule), FALSE);
next->next = NULL;
next->key = string_dequote(&p);
next->next = NULL;
next->key = string_dequote(&p);
-
while (isspace(*p)) p++
;
-if (
*p == 0
)
+
Uskip_whitespace(&p)
;
+if (
!*p
)
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"missing rewrite replacement string");
next->flags = 0;
next->replacement = string_dequote(&p);
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"missing rewrite replacement string");
next->flags = 0;
next->replacement = string_dequote(&p);
-while (*p
!= 0
) switch (*p++)
+while (*p) switch (*p++)
{
case ' ': case '\t': break;
{
case ' ': case '\t': break;
@@
-3001,13
+2999,13
@@
if (*numberp >= max)
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "too many named %ss (max is %d)\n",
tname, max);
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "too many named %ss (max is %d)\n",
tname, max);
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
ss = s;
while (isalnum(*s) || *s == '_') s++;
t = store_get(sizeof(tree_node) + s-ss, is_tainted(ss));
Ustrncpy(t->name, ss, s-ss);
t->name[s-ss] = 0;
ss = s;
while (isalnum(*s) || *s == '_') s++;
t = store_get(sizeof(tree_node) + s-ss, is_tainted(ss));
Ustrncpy(t->name, ss, s-ss);
t->name[s-ss] = 0;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
if (!tree_insertnode(anchorp, t))
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
if (!tree_insertnode(anchorp, t))
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
@@
-3020,7
+3018,7
@@
nb->hide = hide;
if (*s++ != '=') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"missing '=' after \"%s\"", t->name);
if (*s++ != '=') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"missing '=' after \"%s\"", t->name);
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
nb->string = read_string(s, t->name);
nb->cache_data = NULL;
nb->string = read_string(s, t->name);
nb->cache_data = NULL;
@@
-3763,7
+3761,7
@@
while ((buffer = get_config_line()))
/* Check nothing more on this line, then do the next loop iteration. */
/* Check nothing more on this line, then do the next loop iteration. */
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
if (*s) extra_chars_error(s, US"driver name ", name, US"");
continue;
}
if (*s) extra_chars_error(s, US"driver name ", name, US"");
continue;
}
@@
-4016,7
+4014,7
@@
const uschar *pp;
if (*p++ != ',') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "comma expected");
if (*p++ != ',') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "comma expected");
-
while (isspace(*p)) p++
;
+
Uskip_whitespace(&p)
;
pp = p;
while (isalnum(*p) || (type == 1 && *p == '.')) p++;
pp = p;
while (isalnum(*p) || (type == 1 && *p == '.')) p++;
@@
-4057,7
+4055,7
@@
while ((p = get_config_line()))
rchain = &(next->rules);
next->pattern = string_dequote(&p);
rchain = &(next->rules);
next->pattern = string_dequote(&p);
-
while (isspace(*p)) p++
;
+
Uskip_whitespace(&p)
;
pp = p;
while (mac_isgraph(*p)) p++;
if (p - pp <= 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
pp = p;
while (mac_isgraph(*p)) p++;
if (p - pp <= 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
@@
-4074,22
+4072,22
@@
while ((p = get_config_line()))
fudge. Anything that is not a retry rule starting "F," or "G," is treated as
an address list. */
fudge. Anything that is not a retry rule starting "F," or "G," is treated as
an address list. */
-
while (isspace(*p)) p++
;
+
Uskip_whitespace(&p)
;
if (Ustrncmp(p, "senders", 7) == 0)
{
p += 7;
if (Ustrncmp(p, "senders", 7) == 0)
{
p += 7;
-
while (isspace(*p)) p++
;
+
Uskip_whitespace(&p)
;
if (*p++ != '=') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"\"=\" expected after \"senders\" in retry rule");
if (*p++ != '=') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"\"=\" expected after \"senders\" in retry rule");
-
while (isspace(*p)) p++
;
+
Uskip_whitespace(&p)
;
next->senders = string_dequote(&p);
}
/* Now the retry rules. Keep the maximum timeout encountered. */
next->senders = string_dequote(&p);
}
/* Now the retry rules. Keep the maximum timeout encountered. */
-
while (isspace(*p)) p++
;
+
Uskip_whitespace(&p)
;
- while (*p
!= 0
)
+ while (*p)
{
retry_rule *rule = store_get(sizeof(retry_rule), FALSE);
*rchain = rule;
{
retry_rule *rule = store_get(sizeof(retry_rule), FALSE);
*rchain = rule;
@@
-4122,13
+4120,12
@@
while ((p = get_config_line()))
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"bad parameters for retry rule");
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"bad parameters for retry rule");
- while (isspace(*p)) p++;
- if (*p == ';')
+ if (Uskip_whitespace(&p) == ';')
{
p++;
{
p++;
-
while (isspace(*p)) p++
;
+
Uskip_whitespace(&p)
;
}
}
- else if (*p
!= 0
)
+ else if (*p)
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "semicolon expected");
}
}
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "semicolon expected");
}
}
diff --git
a/src/src/smtp_in.c
b/src/src/smtp_in.c
index 9055020e1e5f2391511e9fbdfa873f978814f941..2c54a4ccfb1d7e1622f93862a4f40f5ea7e6ef51 100644
(file)
--- a/
src/src/smtp_in.c
+++ b/
src/src/smtp_in.c
@@
-3194,7
+3194,7
@@
for (;;)
{
smtp_printf("%.3s-%.*s%.*s\r\n", TRUE, code, esclen, esc, (int)(nl - msg), msg);
msg = nl + 1;
{
smtp_printf("%.3s-%.*s%.*s\r\n", TRUE, code, esclen, esc, (int)(nl - msg), msg);
msg = nl + 1;
-
while (isspace(*msg)) msg++
;
+
Uskip_whitespace(&msg)
;
}
}
}
}
}
}
diff --git
a/src/src/smtp_out.c
b/src/src/smtp_out.c
index 12ed5bc612e3fd639056c97ebb479877c41ec5eb..7ea5a7c9a877682c133748875a0c93d49a57796e 100644
(file)
--- a/
src/src/smtp_out.c
+++ b/
src/src/smtp_out.c
@@
-63,8
+63,8
@@
if (is_tainted(expint))
return FALSE;
}
return FALSE;
}
-
while (isspace(*expint)) expint++
;
-if (
*expint == 0
) return TRUE;
+
Uskip_whitespace(&expint)
;
+if (
!*expint
) return TRUE;
while ((iface = string_nextinlist(&expint, &sep, big_buffer,
big_buffer_size)))
while ((iface = string_nextinlist(&expint, &sep, big_buffer,
big_buffer_size)))
diff --git
a/src/src/transports/appendfile.c
b/src/src/transports/appendfile.c
index 426a8c1ed0cd8d3d6635e21a632614730f88a4be..f96d001825aa5fc5ff94d97ccb10cd3d2319fd21 100644
(file)
--- a/
src/src/transports/appendfile.c
+++ b/
src/src/transports/appendfile.c
@@
-289,9
+289,9
@@
for (int i = 0; i < 5; i++)
rest += sizeof("/no_check") - 1;
}
rest += sizeof("/no_check") - 1;
}
-
while (isspace(*rest)) rest++
;
+
Uskip_whitespace(&rest)
;
- if (*rest
!= 0
)
+ if (*rest)
{
*errmsg = string_sprintf("Malformed value \"%s\" (expansion of \"%s\") "
"in %s transport", s, q, tblock->name);
{
*errmsg = string_sprintf("Malformed value \"%s\" (expansion of \"%s\") "
"in %s transport", s, q, tblock->name);
diff --git
a/src/src/verify.c
b/src/src/verify.c
index dc2e5761453c3d94c3f2f7f0a5a50e039bd81cef..4b584c05e6f6af45480adb97a69669056551a3a4 100644
(file)
--- a/
src/src/verify.c
+++ b/
src/src/verify.c
@@
-2417,7
+2417,7
@@
for (int i = 0; i < recipients_count; i++)
colon = Ustrchr(h->text, ':');
s = colon + 1;
colon = Ustrchr(h->text, ':');
s = colon + 1;
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
/* Loop for multiple addresses in the header, enabling group syntax. Note
that we have to reset this after the header has been scanned. */
/* Loop for multiple addresses in the header, enabling group syntax. Note
that we have to reset this after the header has been scanned. */
@@
-2455,7
+2455,7
@@
for (int i = 0; i < recipients_count; i++)
/* Advance to the next address */
s = ss + (terminator ? 1:0);
/* Advance to the next address */
s = ss + (terminator ? 1:0);
-
while (isspace(*s)) s++
;
+
Uskip_whitespace(&s)
;
} /* Next address */
f.parse_allow_group = FALSE;
} /* Next address */
f.parse_allow_group = FALSE;