]> granicus.if.org Git - mutt/commitdiff
Convert last rfc1524_expand_command caller to use a BUFFER.
authorKevin McCarthy <kevin@8t8.us>
Sun, 14 Apr 2019 18:38:49 +0000 (11:38 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 14 Apr 2019 18:38:49 +0000 (11:38 -0700)
rfc1524.c

index 1ef5c4526f094165141189645e215a4ef96b0218..e5b1b85dd00ca7425929f46118ddac686db4f5cc 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -318,20 +318,21 @@ static int rfc1524_mailcap_parse (BODY *a,
           * if this is the right entry.
           */
          char *test_command = NULL;
-         size_t len;
+          BUFFER *command = NULL;
 
          if (get_field_text (field + 4, &test_command, type, filename, line)
              && test_command)
          {
-           len = mutt_strlen (test_command) + STRING;
-           safe_realloc (&test_command, len);
-           rfc1524_expand_command (a, a->filename, type, test_command, len);
-           if (mutt_system (test_command))
+            command = mutt_buffer_pool_get ();
+            mutt_buffer_strcpy (command, test_command);
+           mutt_buffer_rfc1524_expand_command (a, a->filename, type, command);
+           if (mutt_system (mutt_b2s (command)))
            {
              /* a non-zero exit code means test failed */
              found = FALSE;
            }
            FREE (&test_command);
+            mutt_buffer_pool_release (&command);
          }
        }
       } /* while (ch) */