X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/a85c067ba6c6940512cf57ec213277a370d87e70..3f77bd134b64c532748b83c3931df07058268b5e:/src/src/routers/manualroute.c diff --git a/src/src/routers/manualroute.c b/src/src/routers/manualroute.c index 6a500d09a..ffd6eeaca 100644 --- a/src/src/routers/manualroute.c +++ b/src/src/routers/manualroute.c @@ -5,10 +5,12 @@ /* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ -/* SPDX-License-Identifier: GPL-2.0-only */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include "../exim.h" + +#ifdef ROUTER_MANUALROUTE #include "rf_functions.h" #include "manualroute.h" @@ -118,8 +120,8 @@ if (ob->hai_code < 0) /* One of route_list or route_data must be specified */ -if ((ob->route_list == NULL && ob->route_data == NULL) || - (ob->route_list != NULL && ob->route_data != NULL)) +if ( !ob->route_list && !ob->route_data + || ob->route_list && ob->route_data) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s router:\n " "route_list or route_data (but not both) must be specified", rblock->name); @@ -154,17 +156,17 @@ static BOOL 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; } @@ -291,6 +293,7 @@ string, decline. */ else { + GET_OPTION("route_data"); if (!(route_item = rf_expand_data(addr, ob->route_data, &rc))) return rc; (void) parse_route_item(route_item, NULL, &hostlist, &options); @@ -330,8 +333,9 @@ lookup_type = LK_DEFAULT; while (*options) { unsigned n; - const uschar *s = options; - while (*options != 0 && !isspace(*options)) options++; + const uschar * s = options; + + Uskip_nonwhite(&options); n = options-s; if (Ustrncmp(s, "randomize", n) == 0) randomize = TRUE; @@ -365,7 +369,7 @@ while (*options) if (*options) { options++; - while (*options != 0 && isspace(*options)) options++; + Uskip_whitespace(&options); } } @@ -487,5 +491,6 @@ addr->transport = transport; return OK; } -#endif /*!MACRO_PREDEF*/ +#endif /*!MACRO_PREDEF*/ +#endif /*ROUTER_MANUALROUTE*/ /* End of routers/manualroute.c */