constify
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 13 Mar 2022 16:23:31 +0000 (16:23 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 16 Mar 2022 13:34:54 +0000 (13:34 +0000)
src/src/expand.c
src/src/functions.h
src/src/transport.c

index 95bf4ad07fe8e90460543119be44f289f2ab958a..2d55a884666ac4d8e8fd1709b8f76673709a2949 100644 (file)
@@ -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;
index d05d8745067b89cffcf9aea0d474c753f75af6db..f52c155b057a980265f959bb32918f8f02aa91a9 100644 (file)
@@ -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);
index aaef2f6d7a84eb1bff64fb847b943d1a36714416..fbd0bb39b388711aeb8ec634d1fa8da8e9a61b37 100644 (file)
@@ -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)
 {