From: Kevin McCarthy Date: Sun, 14 Apr 2019 22:38:15 +0000 (-0700) Subject: Rename mutt_buffer_rfc1524_expand_command() X-Git-Tag: 2019-10-25~159^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb63ad13d703a0b2b78c7a19e1439d055aef258a;p=neomutt Rename mutt_buffer_rfc1524_expand_command() Remove buffer prefix now that all callers are converted. --- diff --git a/handler.c b/handler.c index 6a6d0fcc9..968a021c9 100644 --- a/handler.c +++ b/handler.c @@ -554,8 +554,8 @@ static int autoview_handler(struct Body *a, struct State *s) else mutt_buffer_strcpy(cmd, entry->command); - /* rfc1524_expand_command returns 0 if the file is required */ - bool piped = mutt_buffer_rfc1524_expand_command(a, mutt_b2s(tempfile), type, cmd); + /* mutt_rfc1524_expand_command returns 0 if the file is required */ + bool piped = mutt_rfc1524_expand_command(a, mutt_b2s(tempfile), type, cmd); if (s->flags & MUTT_DISPLAY) { diff --git a/mutt_attach.c b/mutt_attach.c index 3dd0bcc07..b26eb8089 100644 --- a/mutt_attach.c +++ b/mutt_attach.c @@ -148,7 +148,7 @@ int mutt_compose_attachment(struct Body *a) else mutt_buffer_strcpy(newfile, a->filename); - if (mutt_buffer_rfc1524_expand_command(a, mutt_b2s(newfile), type, cmd)) + if (mutt_rfc1524_expand_command(a, mutt_b2s(newfile), type, cmd)) { /* For now, editing requires a file, no piping */ mutt_error(_("Mailcap compose entry requires %%s")); @@ -285,7 +285,7 @@ int mutt_edit_attachment(struct Body *a) else mutt_buffer_strcpy(newfile, a->filename); - if (mutt_buffer_rfc1524_expand_command(a, mutt_b2s(newfile), type, cmd)) + if (mutt_rfc1524_expand_command(a, mutt_b2s(newfile), type, cmd)) { /* For now, editing requires a file, no piping */ mutt_error(_("Mailcap Edit entry requires %%s")); @@ -482,7 +482,7 @@ int mutt_view_attachment(FILE *fp, struct Body *a, enum ViewAttachMode mode, mutt_file_chmod(mutt_b2s(tmpfile), S_IRUSR); } - use_pipe = mutt_buffer_rfc1524_expand_command(a, mutt_b2s(tmpfile), type, cmd); + use_pipe = mutt_rfc1524_expand_command(a, mutt_b2s(tmpfile), type, cmd); use_pager = entry->copiousoutput; } @@ -1077,7 +1077,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a) return 0; mutt_buffer_strcpy(cmd, entry->printcommand); - piped = mutt_buffer_rfc1524_expand_command(a, mutt_b2s(newfile), type, cmd); + piped = mutt_rfc1524_expand_command(a, mutt_b2s(newfile), type, cmd); mutt_endwin(); diff --git a/rfc1524.c b/rfc1524.c index 4c4dabc65..56fee53e3 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -50,7 +50,7 @@ bool C_MailcapSanitize; ///< Config: Restrict the possible characters in mailcap expandos /** - * mutt_buffer_rfc1524_expand_command - Expand expandos in a command + * mutt_rfc1524_expand_command - Expand expandos in a command * @param a Email Body * @param filename File containing the email text * @param type Type, e.g. "text/plain" @@ -68,8 +68,8 @@ bool C_MailcapSanitize; ///< Config: Restrict the possible characters in mailcap * %n is the integer number of sub-parts in the multipart * %F is "content-type filename" repeated for each sub-part */ -int mutt_buffer_rfc1524_expand_command(struct Body *a, const char *filename, - const char *type, struct Buffer *command) +int mutt_rfc1524_expand_command(struct Body *a, const char *filename, + const char *type, struct Buffer *command) { int needspipe = true; struct Buffer *buf = mutt_buffer_pool_get(); @@ -354,7 +354,7 @@ static bool rfc1524_mailcap_parse(struct Body *a, char *filename, char *type, { struct Buffer *command = mutt_buffer_pool_get(); mutt_buffer_strcpy(command, test_command); - mutt_buffer_rfc1524_expand_command(a, a->filename, type, command); + mutt_rfc1524_expand_command(a, a->filename, type, command); if (mutt_system(mutt_b2s(command))) { /* a non-zero exit code means test failed */ diff --git a/rfc1524.h b/rfc1524.h index 491dd2890..2845d60f1 100644 --- a/rfc1524.h +++ b/rfc1524.h @@ -63,10 +63,9 @@ 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_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); +int mutt_rfc1524_expand_command(struct Body *a, const char *filename, const char *type, struct Buffer *command); #endif /* MUTT_RFC1524_H */