From: Jeremy Harris Date: Sun, 14 Mar 2021 12:54:11 +0000 (+0000) Subject: tidying X-Git-Tag: exim-4.95-RC0~65 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/48e32fe6695541cccec39bb48cebf023f447e462 tidying --- diff --git a/src/src/dbstuff.h b/src/src/dbstuff.h index 89934154a..8a8a5fb67 100644 --- a/src/src/dbstuff.h +++ b/src/src/dbstuff.h @@ -75,7 +75,7 @@ free() must not die when passed NULL */ key.dptr != NULL) /* EXIM_DBDELETE_CURSOR - terminate scanning operation. */ -#define EXIM_DBDELETE_CURSOR(cursor) free(cursor) +#define EXIM_DBDELETE_CURSOR(cursor) store_free(cursor) /* EXIM_DBCLOSE */ #define EXIM_DBCLOSE__(db) tdb_close(db) diff --git a/src/src/deliver.c b/src/src/deliver.c index 9ebd281fc..f2187e22a 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -2884,10 +2884,8 @@ while (addr_local) deliveries (e.g. to pipes) can take a substantial time. */ if (!(dbm_file = dbfn_open(US"retry", O_RDONLY, &dbblock, FALSE, TRUE))) - { DEBUG(D_deliver|D_retry|D_hints_lookup) debug_printf("no retry data available\n"); - } addr2 = addr; addr3 = NULL; diff --git a/src/src/expand.c b/src/src/expand.c index bce335629..989e97b84 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -6431,13 +6431,10 @@ while (*s) condition for real. For EITEM_MAP and EITEM_REDUCE, do the same, using the normal internal expansion function. */ - if (item_type == EITEM_FILTER) - { - if ((temp = eval_condition(expr, &resetok, NULL))) - s = temp; - } - else + if (item_type != EITEM_FILTER) temp = expand_string_internal(s, TRUE, &s, TRUE, TRUE, &resetok); + else + if ((temp = eval_condition(expr, &resetok, NULL))) s = temp; if (!temp) { @@ -6446,7 +6443,7 @@ while (*s) goto EXPAND_FAILED; } - Uskip_whitespace(&s); + Uskip_whitespace(&s); /*{*/ if (*s++ != '}') { /*{*/ expand_string_message = string_sprintf("missing } at end of condition " diff --git a/src/src/string.c b/src/src/string.c index afdb517a2..fbb19537c 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -952,12 +952,15 @@ else s = ss; if (!*s || *++s != sep || sep_is_special) break; } + + /* Trim trailing spaces from the returned string */ + /* while (g->ptr > 0 && isspace(g->s[g->ptr-1])) g->ptr--; */ while ( g->ptr > 0 && isspace(g->s[g->ptr-1]) && (g->ptr == 1 || g->s[g->ptr-2] != '\\') ) g->ptr--; buffer = string_from_gstring(g); - gstring_release_unused(g); + gstring_release_unused_trc(g, func, line); } /* Update the current pointer and return the new string */ @@ -1143,7 +1146,7 @@ BOOL srctaint = is_tainted(s); if (!g) { unsigned inc = count < 4096 ? 127 : 1023; - unsigned size = ((count + inc) & ~inc) + 1; + unsigned size = ((count + inc) & ~inc) + 1; /* round up requested count */ g = string_get_tainted(size, srctaint); } else if (srctaint && !is_tainted(g->s)) diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 52940572b..e7e03213e 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -3607,13 +3607,12 @@ for (int fd_bits = 3; fd_bits; ) timeout = 5; } else - { for (int nbytes = 0; rc - nbytes > 0; nbytes += i) if ((i = write(pfd[0], buf + nbytes, rc - nbytes)) < 0) goto done; - } /* Handle outbound data. We cannot combine payload and the TLS-close - due to the limitations of the (pipe) channel feeding us. */ + due to the limitations of the (pipe) channel feeding us. Maybe use a unix-domain + socket? */ if (FD_ISSET(pfd[0], &rfds)) if ((rc = read(pfd[0], buf, bsize)) <= 0) { @@ -3628,11 +3627,9 @@ for (int fd_bits = 3; fd_bits; ) shutdown(tls_out.active.sock, SHUT_WR); } else - { for (int nbytes = 0; rc - nbytes > 0; nbytes += i) if ((i = tls_write(ct_ctx, buf + nbytes, rc - nbytes, FALSE)) < 0) goto done; - } if (fd_bits & 1) FD_SET(tls_out.active.sock, &rfds); if (fd_bits & 2) FD_SET(pfd[0], &rfds);