]> granicus.if.org Git - neomutt/commitdiff
Rename to mutt_rfc1524_expand_filename()
authorKevin McCarthy <kevin@8t8.us>
Wed, 10 Apr 2019 01:54:20 +0000 (18:54 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 30 Apr 2019 16:45:37 +0000 (17:45 +0100)
Now that all callers pass a struct Buffer, the buffer prefix is not needed to
distinguish the parameter.

Co-authored-by: Richard Russon <rich@flatcap.org>
handler.c
mutt_attach.c
rfc1524.c
rfc1524.h

index 8a7ec223dbe67a641b897f05012d3f14b20e836f..6876828488b2ef6bd6dfd175b531bbbf2e72a46a 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -545,7 +545,7 @@ static int autoview_handler(struct Body *a, struct State *s)
 
   fname = mutt_str_strdup(a->filename);
   mutt_file_sanitize_filename(fname, true);
-  mutt_buffer_rfc1524_expand_filename(entry->nametemplate, fname, tempfile);
+  mutt_rfc1524_expand_filename(entry->nametemplate, fname, tempfile);
   FREE(&fname);
 
   if (entry->command)
index b76090e719f7c471351372800ebae57b9b7e7131..02449aa71f57f246548972574b14ea83969a4d54 100644 (file)
@@ -76,7 +76,7 @@ int mutt_get_tmp_attachment(struct Body *a)
   struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
   snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype);
   rfc1524_mailcap_lookup(a, type, entry, MUTT_MC_NO_FLAGS);
-  mutt_buffer_rfc1524_expand_filename(entry->nametemplate, a->filename, tmpfile);
+  mutt_rfc1524_expand_filename(entry->nametemplate, a->filename, tmpfile);
 
   rfc1524_free_entry(&entry);
 
@@ -134,7 +134,7 @@ int mutt_compose_attachment(struct Body *a)
       else
         mutt_buffer_strcpy(cmd, entry->composecommand);
 
-      if (mutt_buffer_rfc1524_expand_filename(entry->nametemplate, a->filename, newfile))
+      if (mutt_rfc1524_expand_filename(entry->nametemplate, a->filename, newfile))
       {
         mutt_debug(LL_DEBUG1, "oldfile: %s\t newfile: %s\n", a->filename, mutt_b2s(newfile));
         if (mutt_file_symlink(a->filename, mutt_b2s(newfile)) == -1)
@@ -271,7 +271,7 @@ int mutt_edit_attachment(struct Body *a)
     if (entry->editcommand)
     {
       mutt_buffer_strcpy(cmd, entry->editcommand);
-      if (mutt_buffer_rfc1524_expand_filename(entry->nametemplate, a->filename, newfile))
+      if (mutt_rfc1524_expand_filename(entry->nametemplate, a->filename, newfile))
       {
         mutt_debug(LL_DEBUG1, "oldfile: %s\t newfile: %s\n", a->filename, mutt_b2s(newfile));
         if (mutt_file_symlink(a->filename, mutt_b2s(newfile)) == -1)
@@ -454,7 +454,7 @@ int mutt_view_attachment(FILE *fp, struct Body *a, enum ViewAttachMode mode,
     else
       fname = a->filename;
 
-    if (mutt_buffer_rfc1524_expand_filename(entry->nametemplate, fname, tmpfile))
+    if (mutt_rfc1524_expand_filename(entry->nametemplate, fname, tmpfile))
     {
       if (!fp && (mutt_str_strcmp(mutt_b2s(tmpfile), a->filename) != 0))
       {
@@ -1054,7 +1054,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
 
     struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
     rfc1524_mailcap_lookup(a, type, entry, MUTT_MC_PRINT);
-    if (mutt_buffer_rfc1524_expand_filename(entry->nametemplate, a->filename, newfile))
+    if (mutt_rfc1524_expand_filename(entry->nametemplate, a->filename, newfile))
     {
       if (!fp)
       {
index d7ac2d0d880dfef7a550597851bdc986e995f9da..7c074263c658f8a8c37bd107fef9daa99c10eafe 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -513,7 +513,7 @@ bool rfc1524_mailcap_lookup(struct Body *a, char *type,
 }
 
 /**
- * mutt_buffer_rfc1524_expand_filename - Expand a new filename from a template or existing filename
+ * mutt_rfc1524_expand_filename - Expand a new filename from a template or existing filename
  * @param nametemplate Template
  * @param oldfile      Original filename
  * @param newfile      Buffer for new filename
@@ -530,8 +530,8 @@ bool rfc1524_mailcap_lookup(struct Body *a, char *type,
  * for a "%s". If none is found, the nametemplate is used as the template for
  * newfile.  The first path component of the nametemplate and oldfile are ignored.
  */
-int mutt_buffer_rfc1524_expand_filename(const char *nametemplate,
-                                        const char *oldfile, struct Buffer *newfile)
+int mutt_rfc1524_expand_filename(const char *nametemplate, const char *oldfile,
+                                 struct Buffer *newfile)
 {
   int i, j, k;
   char *s = NULL;
index c62c4b062c57db047436426870029f68393722aa..491dd28902af8a8a3e911923d0eb9c58264b29b9 100644 (file)
--- a/rfc1524.h
+++ b/rfc1524.h
@@ -64,7 +64,7 @@ enum MailcapLookup
 struct Rfc1524MailcapEntry *rfc1524_new_entry(void);
 void rfc1524_free_entry(struct Rfc1524MailcapEntry **entry);
 int rfc1524_expand_command(struct Body *a, const char *filename, const char *type, char *command, int clen);
-int mutt_buffer_rfc1524_expand_filename(const char *nametemplate, const char *oldfile, struct Buffer *newfile);
+int mutt_rfc1524_expand_filename(const char *nametemplate, const char *oldfile, struct Buffer *newfile);
 bool rfc1524_mailcap_lookup(struct Body *a, char *type, struct Rfc1524MailcapEntry *entry, enum MailcapLookup opt);
 
 int mutt_buffer_rfc1524_expand_command(struct Body *a, const char *filename, const char *type, struct Buffer *command);