X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/a6d90e094d4e2a84d18859cf2005d10c2020e2d4..51f9c07cd341c9c1a09b3816df988c6f44477c99:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index 6dcd45062..26df25795 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -27,13 +27,6 @@ typedef unsigned esi_flags; # ifndef SUPPORT_CRYPTEQ # define SUPPORT_CRYPTEQ # endif -#else - -/* Recursively called function */ - -static uschar *expand_string_internal(const uschar *, esi_flags, const uschar **, BOOL *, BOOL *); -static int_eximarith_t expanded_string_integer(const uschar *, BOOL); - #endif /*!STAND_ALONE*/ #ifdef LOOKUP_LDAP @@ -942,6 +935,10 @@ static uschar *mtable_sticky[] = #define FH_WANT_RAW BIT(1) #define FH_WANT_LIST BIT(2) +/* Recursively called function */ +static uschar *expand_string_internal(const uschar *, esi_flags, const uschar **, BOOL *, BOOL *); +static int_eximarith_t expanded_string_integer(const uschar *, BOOL); + /************************************************* * Tables for UTF-8 support * @@ -3526,7 +3523,7 @@ switch(cond_type = identify_operator(&s, &opname)) /* Match the given local_part against the SRS-encoded pattern */ - re = regex_must_compile(US"^(?i)SRS0=([^=]+)=([A-Z2-7]+)=([^=]*)=(.*)$", + re = regex_must_compile(US"^(?i)SRS0=([^=]+)=([A-Z2-7]{2})=([^=]*)=(.*)$", MCS_CASELESS | MCS_CACHEABLE, FALSE); md = pcre2_match_data_create(4+1, pcre_gen_ctx); if (pcre2_match(re, sub[0], PCRE2_ZERO_TERMINATED, 0, PCRE_EOPT, @@ -5630,7 +5627,6 @@ while (*s) /* Handle options to the "run" */ while (*s == ',') - { if (Ustrncmp(++s, "preexpand", 9) == 0) { late_expand = FALSE; s += 9; } else @@ -5641,7 +5637,6 @@ while (*s) (int)(t-s), s); goto EXPAND_FAILED; } - } Uskip_whitespace(&s); if (*s != '{') /*}*/ @@ -7066,13 +7061,11 @@ while (*s) { struct timeval now; unsigned long i; - gstring * h = NULL; gettimeofday(&now, NULL); - for (unsigned long i = (now.tv_sec / 86400) & 0x3ff; i; i >>= 5) - h = string_catn(h, &base32_chars[i & 0x1f], 1); - if (h) while (h->ptr > 0) - g = string_catn(g, &h->s[--h->ptr], 1); + i = (now.tv_sec / 86400) & 0x3ff; + g = string_catn(g, &base32_chars[i >> 5], 1); + g = string_catn(g, &base32_chars[i & 0x1f], 1); } g = string_catn(g, US"=", 1);