X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f9ba5e2255cf18092750fffacb6a9603571a2be5..56dbf856f209bbd6c6e211e691b8fd898e01dfe8:/src/src/match.c diff --git a/src/src/match.c b/src/src/match.c index 3539aaab2..43f5912fd 100644 --- a/src/src/match.c +++ b/src/src/match.c @@ -175,10 +175,9 @@ if (cb->at_is_special && pattern[0] == '@') if (Ustrcmp(pattern, "@[]") == 0) { - ip_address_item *ip; int slen = Ustrlen(s); if (s[0] != '[' && s[slen-1] != ']') return FAIL; - for (ip = host_find_interfaces(); ip != NULL; ip = ip->next) + for (ip_address_item * ip = host_find_interfaces(); ip; ip = ip->next) if (Ustrncmp(ip->address, s+1, slen - 2) == 0 && ip->address[slen - 2] == 0) return OK; @@ -297,14 +296,13 @@ else if (!mac_islookup(search_type, lookup_querystyle)) for; partial matching is all handled inside search_find(). Note that there is no search_close() because of the caching arrangements. */ -handle = search_open(filename, search_type, 0, NULL, NULL); -if (handle == NULL) log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", - search_error_message); +if (!(handle = search_open(filename, search_type, 0, NULL, NULL))) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", search_error_message); result = search_find(handle, filename, keyquery, partial, affix, affixlen, starflags, &expand_setup); -if (result == NULL) return search_find_defer? DEFER : FAIL; -if (valueptr != NULL) *valueptr = result; +if (!result) return f.search_find_defer? DEFER : FAIL; +if (valueptr) *valueptr = result; expand_nmax = expand_setup; return OK; @@ -494,7 +492,7 @@ else if (!list) { - if (expand_string_forcedfail) + if (f.expand_string_forcedfail) { HDEBUG(D_lists) debug_printf("expansion of \"%s\" forced failure: " "assume not in this list\n", *listptr); @@ -697,8 +695,8 @@ while ((sss = string_nextinlist(&list, &sep, buffer, sizeof(buffer)))) if (valueptr) { const uschar *key = get_check_key(arg, type); - namedlist_cacheblock *p; - for (p = nb->cache_data; p; p = p->next) + + for (namedlist_cacheblock * p = nb->cache_data; p; p = p->next) if (Ustrcmp(key, p->key) == 0) { *valueptr = p->data; @@ -1066,7 +1064,6 @@ looked up to obtain a list of local parts. If the subject's local part is just if (pattern[0] == '@' && pattern[1] == '@') { int watchdog = 50; - const uschar *key; uschar *list, *ss; uschar buffer[1024]; @@ -1075,7 +1072,7 @@ if (pattern[0] == '@' && pattern[1] == '@') /* Loop for handling chains. The last item in any list may be of the form ">name" in order to chain on to another list. */ - for (key = sdomain + 1; key != NULL && watchdog-- > 0; ) + for (const uschar * key = sdomain + 1; key && watchdog-- > 0; ) { int sep = 0; @@ -1278,7 +1275,6 @@ match_address_list(const uschar *address, BOOL caseless, BOOL expand, const uschar **listptr, unsigned int *cache_bits, int expand_setup, int sep, const uschar **valueptr) { -uschar *p; check_address_block ab; unsigned int *local_cache_bits = cache_bits; @@ -1290,7 +1286,7 @@ the list can be used to restore a caseful copy of the local part from the original address. */ sprintf(CS big_buffer, "%.*s", big_buffer_size - 1, address); -for (p = big_buffer + Ustrlen(big_buffer) - 1; p >= big_buffer; p--) +for (uschar * p = big_buffer + Ustrlen(big_buffer) - 1; p >= big_buffer; p--) { if (!caseless && *p == '@') break; *p = tolower(*p);