client's HELO domain. If the client has not said HELO, use its IP address
instead. If it's a local client (exim -bs), CSA isn't applicable. */
-while (isspace(*domain) && *domain != '\0') ++domain;
+while (isspace(*domain) && *domain) ++domain;
if (*domain == '\0') domain = sender_helo_name;
if (!domain) domain = sender_host_address;
if (!sender_host_address) return CSA_UNKNOWN;
verify_sender_address = sender_address;
else
{
- while (isspace(*s)) s++;
- if (*s++ != '=') goto BAD_VERIFY;
- while (isspace(*s)) s++;
+ if (Uskip_whitespace(&s) != '=')
+ goto BAD_VERIFY;
+ s++;
+ Uskip_whitespace(&s);
verify_sender_address = string_copy(s);
}
}
callout = CALLOUT_TIMEOUT_DEFAULT;
if (*(ss += 7))
{
- while (isspace(*ss)) ss++;
+ Uskip_whitespace(&ss);
if (*ss++ == '=')
{
const uschar * sublist = ss;
int optsep = ',';
- while (isspace(*sublist)) sublist++;
+ Uskip_whitespace(&sublist);
for (uschar * opt; opt = string_nextinlist(&sublist, &optsep, NULL, 0); )
{
callout_opt_t * op;
if (op->has_option)
{
opt += Ustrlen(op->name);
- while (isspace(*opt)) opt++;
+ Uskip_whitespace(&opt);
if (*opt++ != '=')
{
*log_msgptr = string_sprintf("'=' expected after "
"\"%s\" in ACL verify condition \"%s\"", op->name, arg);
return ERROR;
}
- while (isspace(*opt)) opt++;
+ Uskip_whitespace(&opt);
}
if (op->timeval && (period = v_period(opt, arg, log_msgptr)) < 0)
return ERROR;
quota = TRUE;
if (*(ss += 5))
{
- while (isspace(*ss)) ss++;
+ Uskip_whitespace(&ss);
if (*ss++ == '=')
{
const uschar * sublist = ss;
int optsep = ',';
int period;
- while (isspace(*sublist)) sublist++;
+ Uskip_whitespace(&sublist);
for (uschar * opt; opt = string_nextinlist(&sublist, &optsep, NULL, 0); )
if (Ustrncmp(opt, "cachepos=", 9) == 0)
if ((period = v_period(opt += 9, arg, log_msgptr)) < 0)
}
s++;
}
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
if (logbits == 0) logbits = LOG_MAIN;
log_write(0, logbits, "%s", string_printing(s));
/* At top level, we expand the incoming string. At lower levels, it has already
been expanded as part of condition processing. */
-if (acl_level == 0)
+if (acl_level != 0)
+ ss = s;
+else if (!(ss = expand_string(s)))
{
- if (!(ss = expand_string(s)))
- {
- if (f.expand_string_forcedfail) return OK;
- *log_msgptr = string_sprintf("failed to expand ACL string \"%s\": %s", s,
- expand_string_message);
- return ERROR;
- }
+ if (f.expand_string_forcedfail) return OK;
+ *log_msgptr = string_sprintf("failed to expand ACL string \"%s\": %s", s,
+ expand_string_message);
+ return ERROR;
}
-else ss = s;
-while (isspace(*ss)) ss++;
+Uskip_whitespace(&ss);
/* If we can't find a named ACL, the default is to parse it as an inline one.
(Unless it begins with a slash; non-existent files give rise to an error.) */
for (i = 0; i < 9; i++)
{
- while (*s && isspace(*s)) s++;
- if (!*s) break;
+ if (!Uskip_whitespace(&s))
+ break;
if (!(tmp = string_dequote(&s)) || !(tmp_arg[i] = expand_string(tmp)))
{
tmp = name;
{
count = Uatoi(cmd);
while (isdigit((uschar)*cmd)) cmd++;
- while (isspace((uschar)*cmd)) cmd++;
+ Uskip_whitespace(&cmd);
}
if (Ustrncmp(cmd, "open", 4) == 0)
int i;
open_db *odb;
uschar *s = cmd + 4;
- while (isspace((uschar)*s)) s++;
+ Uskip_whitespace(&s);
for (i = 0; i < max_db; i++)
if (dbblock[i].dbptr == NULL) break;
else if (Ustrncmp(cmd, "write", 5) == 0)
{
int rc = 0;
- uschar *key = cmd + 5;
- uschar *data;
+ uschar * key = cmd + 5, * data;
if (current < 0)
{
continue;
}
- while (isspace((uschar)*key)) key++;
+ Uskip_whitespace(&key);
data = key;
- while (*data != 0 && !isspace((uschar)*data)) data++;
+ while (*data && !isspace((uschar)*data)) data++;
*data++ = 0;
- while (isspace((uschar)*data)) data++;
+ Uskip_whitespace(&data);
dbwait = (dbdata_wait *)(&structbuffer);
Ustrcpy(dbwait->text, data);
else if (Ustrncmp(cmd, "read", 4) == 0)
{
- uschar *key = cmd + 4;
+ uschar * key = cmd + 4;
if (current < 0)
{
printf("No current database\n");
continue;
}
- while (isspace((uschar)*key)) key++;
+ Uskip_whitespace(&key);
start = clock();
while (count-- > 0)
dbwait = (dbdata_wait *)dbfn_read_with_length(dbblock+ current, key, NULL);
else if (Ustrncmp(cmd, "delete", 6) == 0)
{
- uschar *key = cmd + 6;
+ uschar * key = cmd + 6;
if (current < 0)
{
printf("No current database\n");
continue;
}
- while (isspace((uschar)*key)) key++;
+ Uskip_whitespace(&key);
dbfn_delete(dbblock + current, key);
}
else if (Ustrncmp(cmd, "close", 5) == 0)
{
- uschar *s = cmd + 5;
- while (isspace((uschar)*s)) s++;
+ uschar * s = cmd + 5;
+ Uskip_whitespace(&s);
i = Uatoi(s);
if (i >= max_db || dbblock[i].dbptr == NULL) printf("Not open\n"); else
{
else if (Ustrncmp(cmd, "file", 4) == 0)
{
- uschar *s = cmd + 4;
- while (isspace((uschar)*s)) s++;
+ uschar * s = cmd + 4;
+ Uskip_whitespace(&s);
i = Uatoi(s);
if (i >= max_db || dbblock[i].dbptr == NULL) printf("Not open\n");
else current = i;
#endif
/* End of dbfn.c */
+/* vi: aw ai sw=2
+*/
reset_point = store_mark();
while (Ufgets(big_buffer, big_buffer_size, trust_list))
{
- uschar *start = big_buffer, *nl;
- while (*start && isspace(*start))
- start++;
- if (*start != '/')
+ uschar * start = big_buffer, * nl;
+ if (Uskip_whitespace(&start) != '/')
continue;
- nl = Ustrchr(start, '\n');
- if (nl)
- *nl = 0;
+ if ((nl = Ustrchr(start, '\n')))
+ *nl = '\0';
trusted_configs[nr_configs++] = string_copy(start);
if (nr_configs == nelem(trusted_configs))
break;
const uschar * s = argrest;
opt_D_used = TRUE;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
if (*s < 'A' || *s > 'Z')
exim_fail("exim: macro name set by -D must start with "
}
name[ptr] = 0;
if (ptr == 0) { badarg = TRUE; break; }
- while (isspace(*s)) s++;
- if (*s != 0)
+ if (Uskip_whitespace(&s))
{
if (*s++ != '=') { badarg = TRUE; break; }
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
}
for (m = macros_user; m; m = m->next)
receive_add_recipient(string_copy_taint(recipient, GET_TAINTED), -1);
s = ss;
if (!finished)
- while (*(++s) != 0 && (*s == ',' || isspace(*s)));
+ while (*++s && (*s == ',' || isspace(*s)));
}
}
while (*s && *s != '=' && !isspace(*s)) s++;
dkeylength = s - dkey;
- if (Uskip_whitespace(&s) == '=') while (isspace(*++s));
+ if (Uskip_whitespace(&s) == '=')
+ while (isspace(*++s)) ;
data = string_dequote(&s);
if (length == dkeylength && strncmpic(key, dkey, length) == 0)
if (*s != ')')
*error = US"expecting closing parenthesis";
else
- while (isspace(*++s));
+ while (isspace(*++s)) ;
else if (*s)
*error = US"expecting operator";
*sptr = s;
for (;;)
{
while (isspace(*ptr))
- {
- if (*ptr == '\n') line_number++;
- ptr++;
- }
+ if (*ptr++ == '\n') line_number++;
if (comment_allowed && *ptr == '#')
- {
- while (*(++ptr) != '\n' && *ptr != 0);
- continue;
- }
- else break;
+ while (*++ptr != '\n' && *ptr) ;
+ else
+ break;
}
return ptr;
}
static const uschar *
nextword(const uschar *ptr, uschar *buffer, int size, BOOL bracket)
{
-uschar *bp = buffer;
-while (*ptr != 0 && !isspace(*ptr) &&
+uschar * bp = buffer;
+while (*ptr && !isspace(*ptr) &&
(!bracket || (*ptr != '(' && *ptr != ')')))
- {
- if (bp - buffer < size - 1) *bp++ = *ptr++; else
+ if (bp - buffer < size - 1)
+ *bp++ = *ptr++;
+ else
{
*error_pointer = string_sprintf("word is too long in line %d of "
"filter file (max = %d chars)", line_number, size);
break;
}
- }
-*bp = 0;
+
+*bp = '\0';
return nextsigchar(ptr, TRUE);
}
if (sscanf(CS s, "%i%n", &value, &count) != 1) return 0;
if (tolower(s[count]) == 'k') { value *= 1024; count++; }
if (tolower(s[count]) == 'm') { value *= 1024*1024; count++; }
-while (isspace((s[count]))) count++;
-if (s[count] != 0) return 0;
+while (isspace(s[count])) count++;
+if (s[count]) return 0;
*ok = TRUE;
return value;
}
if (subtype == TRUE)
{
- while (isspace(*s)) s++;
- if (*s)
+ if (Uskip_whitespace(&s))
{
header_add(htype_other, "%s%s", s,
s[Ustrlen(s)-1] == '\n' ? "" : "\n");
gstring * log_addr = NULL;
if (!to) to = expand_string(US"$reply_address");
- while (isspace(*to)) to++;
+ Uskip_whitespace(&to);
for (tt = to; *tt; tt++) /* Get rid of newlines */
if (*tt == '\n')
/* Move on past this address */
tt = ss + (*ss ? 1 : 0);
- while (isspace(*tt)) tt++;
+ Uskip_whitespace(&tt);
}
if (log_addr)
/* End of filter.c */
+/* vi: aw ai sw=2
+*/
/* If the string starts with '>' we change the output separator.
If it's followed by ';' or ',' we set the TXT output separator. */
-while (isspace(*keystring)) keystring++;
-if (*keystring == '>')
+if (Uskip_whitespace(&keystring) == '>')
{
outsep = keystring + 1;
keystring += 2;
outsep2 = US"";
keystring++;
}
- while (isspace(*keystring)) keystring++;
+ Uskip_whitespace(&keystring);
}
/* Check for a modifier keyword. */
else
break;
- while (isspace(*keystring)) keystring++;
+ Uskip_whitespace(&keystring);
if (*keystring++ != ',')
{
*errmsg = US"dnsdb modifier syntax error";
rc = DEFER;
goto out;
}
- while (isspace(*keystring)) keystring++;
+ Uskip_whitespace(&keystring);
}
/* Figure out the "type" value if it is not T_TXT.
}
keystring = equals + 1;
- while (isspace(*keystring)) keystring++;
+ Uskip_whitespace(&keystring);
}
/* Initialize the resolver in case this is the first time it has been used. */
uschar **errmsg)
{
BOOL defer_break = FALSE;
-int timelimit = LDAP_NO_LIMIT;
-int sizelimit = LDAP_NO_LIMIT;
+int timelimit = LDAP_NO_LIMIT, sizelimit = LDAP_NO_LIMIT;
int tcplimit = 0;
int sep = 0;
int dereference = LDAP_DEREF_NEVER;
-void* referrals = LDAP_OPT_ON;
-const uschar *url = ldap_url;
-const uschar *p;
-uschar *user = NULL;
-uschar *password = NULL;
-uschar *local_servers = NULL;
-const uschar *list;
+void * referrals = LDAP_OPT_ON;
+const uschar * url = ldap_url, * p, * list;
+uschar * user = NULL, * password = NULL, * local_servers = NULL;
-while (isspace(*url)) url++;
+Uskip_whitespace(&url);
/* Until the string begins "ldap", search for the other parameter settings that
are recognized. They are of the form NAME=VALUE, with the value being
DEBUG(D_lookup) debug_printf_indent("LDAP query error: %s\n", *errmsg);
return DEFER;
}
- while (isspace(*url)) url++;
+ Uskip_whitespace(&url);
continue;
}
}
this_is_comment = (this_is_comment || (buffer[0] == 0 || buffer[0] == '#'));
if (this_is_comment) continue;
if (!isspace((uschar)buffer[0])) break;
- while (isspace((uschar)*s)) s++;
- *(--s) = ' ';
+ Uskip_whitespace(&s);
+ *--s = ' ';
}
if (this_is_comment) continue;
else for (int i = 0; i < num_fields; i++)
{
int slen;
- uschar *s = US desc[i].buf;
+ uschar * s = US desc[i].buf;
- while (*s != 0 && isspace(*s)) s++;
+ Uskip_whitespace(&s);
slen = Ustrlen(s);
while (slen > 0 && isspace(s[slen-1])) slen--;
result = string_catn(result, s, slen);
int siz, ptr, i;
uschar c;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
for (i = 0; *s && i < nele(argv); i++)
{
argv[i] = string_from_gstring(g);
DEBUG(D_lookup) debug_printf_indent("REDIS: argv[%d] '%s'\n", i, argv[i]);
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
}
/* Run the command. We use the argv form rather than plain as that parses
if (*ss == '!')
{
yield = FAIL;
- while (isspace((*(++ss))));
+ while (isspace(*++ss)) ;
}
else
yield = OK;
while (Ufgets(filebuffer, sizeof(filebuffer), f) != NULL)
{
- uschar *error;
- uschar *sss = filebuffer;
+ uschar * error, * sss = filebuffer;
while ((ss = Ustrchr(sss, '#')) != NULL)
{
if ((type != MCL_ADDRESS && type != MCL_LOCALPART) ||
ss == filebuffer || isspace(ss[-1]))
{
- *ss = 0;
+ *ss = '\0';
break;
}
sss = ss + 1;
ss = filebuffer + Ustrlen(filebuffer); /* trailing space */
while (ss > filebuffer && isspace(ss[-1])) ss--;
- *ss = 0;
+ *ss = '\0';
ss = filebuffer;
- while (isspace(*ss)) ss++; /* leading space */
-
- if (!*ss) continue; /* ignore empty */
+ if (!Uskip_whitespace(&ss)) /* leading space */
+ continue; /* ignore empty */
file_yield = yield; /* positive yield */
sss = ss; /* for debugging */
if (*ss == '!') /* negation */
{
- file_yield = (file_yield == OK)? FAIL : OK;
- while (isspace((*(++ss))));
+ file_yield = file_yield == OK ? FAIL : OK;
+ while (isspace(*++ss)) ;
}
switch ((func)(arg, ss, valueptr, &error))
if (*ss == '!')
{
local_yield = FAIL;
- while (isspace((*(++ss))));
+ while (isspace(*++ss)) ;
}
else local_yield = OK;
while ((item = string_nextinlist(&listptr, &sep, NULL, 0)))
{
- const uschar *newaddress = item;
- const uschar *pattern = string_dequote(&newaddress);
+ const uschar * newaddress = item;
+ const uschar * pattern = string_dequote(&newaddress);
/* If no new address found, just skip this item. */
- while (isspace(*newaddress)) newaddress++;
- if (*newaddress == 0) continue;
+ if (!Uskip_whitespace(&newaddress)) continue;
/* We now have an item to match as an address in item, and the additional
address in newaddress. If the pattern matches, expand the new address string
*error = string_sprintf("\"%.*s\" is not permitted", len, s);
return FF_ERROR;
}
- while (*ss && isspace(*ss)) ss++; /* skip leading whitespace */
+ Uskip_whitespace(&ss); /* skip leading whitespace */
if ((len = Ustrlen(ss)) > 0) /* ignore trailing newlines */
for (const uschar * t = ss + len - 1; t >= ss && *t == '\n'; t--) len--;
*error = string_copyn(ss, len); /* becomes the error */
DEBUG(D_acl) debug_printf(" %.*s=%s\n", taglen, tspec, val);
while (taglen > 1 && isspace(tspec[taglen-1]))
taglen--; /* Ignore whitespace before = */
- while (isspace(*val))
- val++; /* Ignore whitespace after = */
+ Uskip_whitespace(&val); /* Ignore whitespace after = */
if (isspace(val[ Ustrlen(val)-1 ]))
{ /* Ignore whitespace after value */
gstring * g = string_cat(NULL, val);
/* Step through the string looking for the required fields. Ensure
strict adherence to required formatting, exit for any error. */
p += 5;
- if (!isspace(*(p++)))
+ if (!isspace(*p++))
{
DEBUG(D_receive) debug_printf("Missing space after PROXY command\n");
goto proxyfail;
}
p += Ustrlen(iptype);
- if (!isspace(*(p++)))
+ if (!isspace(*p++))
{
DEBUG(D_receive) debug_printf("Missing space after TCP4/6 command\n");
goto proxyfail;
(Ustrncmp(ss+8, "_if_exists", 10) == 0 && isspace(ss[18]))))
{
uschar *t;
- int include_if_exists = isspace(ss[8])? 0 : 10;
+ int include_if_exists = isspace(ss[8]) ? 0 : 10;
config_file_item *save;
struct stat statbuf;
/* There may be leading spaces; thereafter, we expect an option name starting
with a letter. */
-while (isspace(*s)) s++;
-if (!isalpha(*s))
+if (!isalpha( Uskip_whitespace(&s) ))
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "option setting expected: %s", s);
/* Read the name of the option, and skip any subsequent white space. If
s++;
}
name[ptr] = 0;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
if (Ustrcmp(name, "hide") != 0) break;
issecure = opt_secure;
ptr = 0;
/* Skip white space after = */
-if (*s == '=') while (isspace((*(++s))));
+if (*s == '=') while (isspace(*++s));
/* If there is a data block and the opt_public flag is not set, change
the data block pointer to the private options block. */
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"absolute value of integer \"%s\" is too large (overflow)", s);
- while (isspace(*endptr)) endptr++;
- if (*endptr)
+ if (Uskip_whitespace(&endptr))
extra_chars_error(endptr, inttype, US"integer value for ", name);
value = (int)lvalue;
if (errno == ERANGE) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"absolute value of integer \"%s\" is too large (overflow)", s);
- while (isspace(*endptr)) endptr++;
- if (*endptr != 0)
+ if (Uskip_whitespace(&endptr))
extra_chars_error(endptr, inttype, US"integer value for ", name);
if (data_block)
list[count+1] = value;
if (snext == NULL) break;
s = snext + 1;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
}
if (count > list[0] - 2)
"failed to expand localhost_number \"%s\": %s",
host_number_string, expand_string_message);
n = Ustrtol(s, &end, 0);
- while (isspace(*end)) end++;
- if (*end)
+ if (Uskip_whitespace(&end))
log_write(0, LOG_PANIC_DIE|LOG_CONFIG,
"localhost_number value is not a number: %s", s);
if (n > LOCALHOST_MAX)
*/
static int
-retry_arg(const uschar **paddr, int type)
+retry_arg(const uschar ** paddr, int type)
{
-const uschar *p = *paddr;
-const uschar *pp;
+const uschar * p = *paddr, * pp;
if (*p++ != ',') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "comma expected");
pp = p;
while (isalnum(*p) || (type == 1 && *p == '.')) p++;
-if (*p != 0 && !isspace(*p) && *p != ',' && *p != ';')
+if (*p && !isspace(*p) && *p != ',' && *p != ';')
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "comma or semicolon expected");
*paddr = p;
r = store_mark();
/* skip over to the first non-space */
- for (current = string_copy(i->line); *current && isspace(*current); ++current)
- ;
-
- if (!*current)
+ current = string_copy(i->line);
+ if (!Uskip_whitespace(¤t))
continue;
/* Collapse runs of spaces. We stop this if we encounter one of the
for (p = current; *p; p++) if (isspace(*p))
{
- uschar *next;
+ uschar * next = p;
if (*p != ' ') *p = ' ';
- for (next = p; isspace(*next); ++next)
- ;
+ Uskip_whitespace(&p);
if (next - p > 1)
memmove(p+1, next, Ustrlen(next)+1);
if (isspace(*p)) break;
while (mac_isgraph(*p) && *p != ':') p++;
- while (isspace(*p)) p++;
- if (*p != ':')
+ if (Uskip_whitespace(&p) != ':')
{
body_zerocount = had_zero;
break;
if (!smtp_input)
{
int len;
- uschar *s = Ustrchr(h->text, ':') + 1;
- while (isspace(*s)) s++;
+ uschar * s = Ustrchr(h->text, ':') + 1;
+
+ Uskip_whitespace(&s);
len = h->slen - (s - h->text) - 1;
if (Ustrlen(originator_login) == len &&
strncmpic(s, originator_login, len) == 0)
{
- uschar *name = is_resent? US"Resent-From" : US"From";
+ uschar * name = is_resent ? US"Resent-From" : US"From";
header_add(htype_from, "%s: %s <%s@%s>\n", name, originator_name,
originator_login, qualify_domain_sender);
from_header = header_last;
if (filter_test != FTEST_NONE)
{
- uschar *start = h->text + 12;
- uschar *end = start + Ustrlen(start);
- while (isspace(*start)) start++;
+ uschar * start = h->text + 12;
+ uschar * end = start + Ustrlen(start);
+
+ Uskip_whitespace(&start);
while (end > start && isspace(end[-1])) end--;
if (*start == '<' && end[-1] == '>')
- {
- start++;
- end--;
- }
+ { start++; end--; }
return_path = string_copyn(start, end - start);
printf("Return-path taken from \"Return-path:\" header line\n");
}
(!contains_resent_headers || strncmpic(h->text, US"resent-", 7) == 0))
{
uschar * s = Ustrchr(h->text, ':') + 1;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
f.parse_allow_group = TRUE; /* Allow address group syntax */
/* Move on past this address */
s = ss + (*ss ? 1 : 0);
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
} /* Next address */
f.parse_allow_group = FALSE; /* Reset group syntax flags */
rmark function_reset_point = store_mark();
uschar * s = Ustrchr(h->text, ':') + 1;
-while (isspace(*s)) s++;
+Uskip_whitespace(&s);
DEBUG(D_rewrite) /* The header text includes the trailing newline */
debug_printf_indent("rewrite_one_header: type=%c:\n %s", h->type, h->text);
recipient = parse_extract_address(s, &errmess, &start, &end, &domain, FALSE);
*ss1 = terminator;
s = ss + (*ss ? 1 : 0);
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
/* There isn't much we can do for syntactic disasters at this stage.
Pro tem (possibly for ever) ignore them.
mimeword = decode_mimeword(string, lencheck, &q1, &q2, &endword, &dlen, &dptr);
if (mimeword)
{
- uschar *s = string;
- while (isspace(*s)) s++;
+ uschar * s = string;
+ Uskip_whitespace(&s);
if (s == mimeword) string = s;
}
}
else if (Ustrncmp(s, "reroute:", 8) == 0)
{
s += 8;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
if (Ustrncmp(s, "rewrite:", 8) == 0)
{
r->self_rewrite = TRUE;
s += 8;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
}
r->self = s;
r->self_code = self_reroute;
if (*ss == '+')
{
eacces_code = 1;
- while (isspace((*(++ss))));
+ while (isspace(*++ss));
}
if (*ss == '!')
{
invert = TRUE;
- while (isspace((*(++ss))));
+ while (isspace(*++ss));
}
if (*ss != '/')
}
name += 2;
- while (isspace(*assignment)) assignment++;
+ Uskip_whitespace(&assignment);
if (!(val = expand_string(US assignment)))
if (f.expand_string_forcedfail)
parse_route_item(const uschar *s, const uschar **domain, const uschar **hostlist,
const uschar **options)
{
-while (*s != 0 && isspace(*s)) s++;
+Uskip_whitespace(&s);
if (domain)
{
if (!*s) return FALSE; /* missing data */
*domain = string_dequote(&s);
- while (*s && isspace(*s)) s++;
+ Uskip_whitespace(&s);
}
*hostlist = string_dequote(&s);
-while (*s && isspace(*s)) s++;
+Uskip_whitespace(&s);
*options = s;
return TRUE;
}
while (*options)
{
unsigned n;
- const uschar *s = options;
- while (*options != 0 && !isspace(*options)) options++;
+ const uschar * s = options;
+
+ while (*options && !isspace(*options)) options++;
n = options-s;
if (Ustrncmp(s, "randomize", n) == 0) randomize = TRUE;
if (*options)
{
options++;
- while (*options != 0 && isspace(*options)) options++;
+ while (*options && isspace(*options)) options++;
}
}
DEBUG(D_route) debug_printf("command wrote: %s\n", buffer);
rword = buffer;
-while (isspace(*rword)) rword++;
+Uskip_whitespace(&rword);
rdata = rword;
while (*rdata && !isspace(*rdata)) rdata++;
-if (*rdata) *rdata++ = 0;
+if (*rdata) *rdata++ = '\0';
/* The word must be a known yield name. If it is "REDIRECT", the rest of the
line is redirection data, as for a .forward file. It may not contain filter
follow the sender address. */
smtp_cmd_argument = smtp_cmd_buffer + p->len;
- while (isspace(*smtp_cmd_argument)) smtp_cmd_argument++;
+ Uskip_whitespace(&smtp_cmd_argument);
Ustrcpy(smtp_data_buffer, smtp_cmd_argument);
smtp_cmd_data = smtp_data_buffer;
if (*smtp_cmd_data)
{
- *smtp_cmd_data++ = 0;
- while (isspace(*smtp_cmd_data)) smtp_cmd_data++;
+ *smtp_cmd_data++ = '\0';
+ Uskip_whitespace(&smtp_cmd_data);
}
/* Search for an authentication mechanism which is configured for use
if (!f.sender_host_unknown)
{
BOOL old_helo_verified = f.helo_verified;
- uschar *p = smtp_cmd_data;
+ uschar * p = smtp_cmd_data;
- while (*p != 0 && !isspace(*p)) { *p = tolower(*p); p++; }
- *p = 0;
+ while (*p && !isspace(*p)) { *p = tolower(*p); p++; }
+ *p = '\0';
/* Force a reverse lookup if HELO quoted something in helo_lookup_domains
because otherwise the log can be confusing. */
if (outblock->authenticating)
{
- uschar *p = big_buffer;
+ uschar * p = big_buffer;
if (Ustrncmp(big_buffer, "AUTH ", 5) == 0)
{
p += 5;
- while (isspace(*p)) p++;
+ Uskip_whitespace(&p);
while (!isspace(*p)) p++;
- while (isspace(*p)) p++;
+ Uskip_whitespace(&p);
}
while (*p) *p++ = '*';
}
for (uschar * s = exp; *s; /**/)
{
- while (isspace(*s)) ++s;
- if (*s == '\0')
+ if (!Uskip_whitespace(&s))
break;
if (*s != '+' && *s != '-')
{
s = newlist + Ustrlen(newlist);
while (s > newlist && (isspace(s[-1]) || s[-1] == ',')) s--;
-*s = 0;
+*s = '\0';
/* Check to see if there any addresses left; if not, return NULL */
s = newlist;
-while (s && isspace(*s)) s++;
-if (*s)
+if (Uskip_whitespace(&s))
return newlist;
store_reset(reset_point);
if (h)
{
message_id = Ustrchr(h->text, ':') + 1;
- while (isspace(*message_id)) message_id++;
+ Uskip_whitespace(&message_id);
fprintf(fp, "In-Reply-To: %s", message_id);
}
else
{
cmd = addr->local_part + 1;
- while (isspace(*cmd)) cmd++;
+ Uskip_whitespace(&cmd);
expand_arguments = testflag(addr, af_expand_pipe);
expand_fail = FAIL;
}
case ERRNO_SMTPFORMAT: /* Handle malformed SMTP response */
s = string_printing(buffer);
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
*message = *s == 0
? string_sprintf("Malformed SMTP reply (an empty line) "
"in response to %s%s", pl, smtp_command)
if (regex_match(regex_LIMITS, sx->buffer, -1, &match))
for (const uschar * s = sx->buffer + Ustrlen(match); *s; )
{
- while (isspace(*s)) s++;
- if (*s == '\n') break;
+ if (Uskip_whitespace(&s) == '\n') break;
if (strncmpic(s, US"MAILMAX=", 8) == 0)
{
{
DEBUG(D_transport) debug_printf("skipping %s authenticator: %s\n",
au->name,
- (au->client)? "client_condition is false" :
- "not configured as a client");
+ au->client ? "client_condition is false"
+ : "not configured as a client");
continue;
}
while (*p)
{
- int len = Ustrlen(au->public_name);
- int rc;
+ int len = Ustrlen(au->public_name), rc;
- while (isspace(*p)) p++;
+ Uskip_whitespace(&p);
if (strncmpic(au->public_name, p, len) != 0 ||
- (p[len] != 0 && !isspace(p[len])))
+ (p[len] && !isspace(p[len])))
{
- while (*p != 0 && !isspace(*p)) p++;
+ while (*p && !isspace(*p)) p++;
continue;
}
f.parse_allow_group = TRUE;
- while (*s != 0)
+ while (*s)
{
- address_item *vaddr;
+ address_item * vaddr;
while (isspace(*s) || *s == ',') s++;
- if (*s == 0) break; /* End of header */
+ if (!*s) break; /* End of header */
ss = parse_find_address_end(s, FALSE);
while (isspace(ss[-1])) ss--;
terminator = *ss;
- *ss = 0;
+ *ss = '\0';
HDEBUG(D_verify) debug_printf("verifying %.*s header address %s\n",
(int)(endname - h->text), h->text, s);
goto END_OFF;
p = buffer + qlen + n;
-while(isspace(*p)) p++;
+Uskip_whitespace(&p);
if (*p++ != ':') goto END_OFF;
-while(isspace(*p)) p++;
+Uskip_whitespace(&p);
if (Ustrncmp(p, "USERID", 6) != 0) goto END_OFF;
p += 6;
-while(isspace(*p)) p++;
+Uskip_whitespace(&p);
if (*p++ != ':') goto END_OFF;
-while (*p != 0 && *p != ':') p++;
-if (*p++ == 0) goto END_OFF;
-while(isspace(*p)) p++;
-if (*p == 0) goto END_OFF;
+while (*p && *p != ':') p++;
+if (!*p++) goto END_OFF;
+Uskip_whitespace(&p);
+if (!*p) goto END_OFF;
/* The rest of the line is the data we want. We turn it into printing
characters when we save it, so that it cannot mess up the format of any logging
key = filename;
while (*key != 0 && !isspace(*key)) key++;
filename = string_copyn(filename, key - filename);
- while (isspace(*key)) key++;
+ Uskip_whitespace(&key);
}
else if (mac_islookup(search_type, lookup_querystyle))
{
}
case XCLIENT_SKIP_SPACES:
- while (*s && isspace (*s)) s++;
+ Uskip_whitespace(&s);
state = XCLIENT_READ_COMMAND;
break;