From 06f765450c70d1abcf13fbfbbd17cfc00e0ba02a Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 13 Mar 2022 16:23:31 +0000 Subject: [PATCH] constify --- src/src/expand.c | 18 +++++++++--------- src/src/functions.h | 2 +- src/src/transport.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/src/expand.c b/src/src/expand.c index 95bf4ad07..2d55a8846 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -5526,10 +5526,7 @@ while (*s) case EITEM_RUN: { FILE * f; - uschar * arg; - const uschar ** argv; - pid_t pid; - int fd_in, fd_out; + const uschar * arg, ** argv; if ((expand_forbid & RDO_RUN) != 0) { @@ -5538,16 +5535,17 @@ while (*s) } Uskip_whitespace(&s); - if (*s != '{') + if (*s != '{') /*}*/ { expand_string_message = US"missing '{' for command arg of run"; - goto EXPAND_FAILED_CURLY; + goto EXPAND_FAILED_CURLY; /*"}*/ } if (!(arg = expand_string_internal(s+1, TRUE, &s, skipping, TRUE, &resetok))) goto EXPAND_FAILED; Uskip_whitespace(&s); + /*{*/ if (*s++ != '}') - { + { /*{*/ expand_string_message = US"missing '}' closing command arg of run"; goto EXPAND_FAILED_CURLY; } @@ -5559,6 +5557,9 @@ while (*s) } else { + int fd_in, fd_out; + pid_t pid; + if (!transport_set_up_command(&argv, /* anchor for arg list */ arg, /* raw command */ FALSE, /* don't expand the arguments */ @@ -5576,7 +5577,7 @@ while (*s) expand_string_message = string_sprintf("couldn't create child process: %s", strerror(errno)); goto EXPAND_FAILED; - } + } /* Nothing is written to the standard input. */ @@ -6417,7 +6418,6 @@ while (*s) goto EXPAND_FAILED; /*{{*/ if (*s++ != '}') { - /*{*/ expand_string_message = string_sprintf("missing '}' closing first arg of %s", name); goto EXPAND_FAILED_CURLY; diff --git a/src/src/functions.h b/src/src/functions.h index d05d87450..f52c155b0 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -615,7 +615,7 @@ extern BOOL transport_pass_socket(const uschar *, const uschar *, const uscha #endif ); extern uschar *transport_rcpt_address(address_item *, BOOL); -extern BOOL transport_set_up_command(const uschar ***, uschar *, +extern BOOL transport_set_up_command(const uschar ***, const uschar *, BOOL, int, address_item *, const uschar *, uschar **); extern void transport_update_waiting(host_item *, uschar *); extern BOOL transport_write_block(transport_ctx *, uschar *, int, BOOL); diff --git a/src/src/transport.c b/src/src/transport.c index aaef2f6d7..fbd0bb39b 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -2075,7 +2075,7 @@ Returns: TRUE if all went well; otherwise an error will be */ BOOL -transport_set_up_command(const uschar ***argvptr, uschar *cmd, +transport_set_up_command(const uschar *** argvptr, const uschar * cmd, BOOL expand_arguments, int expand_failed, address_item *addr, const uschar * etext, uschar ** errptr) { -- 2.30.2