From 70e9ad0d77eb1c2d7ef76afdba6825de75d5599f Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 26 Nov 2006 17:31:33 +0100 Subject: [PATCH] mutt_expand_file_fmt -> m_quotefile_fmt in file.c Signed-off-by: Pierre Habouzit --- lib-lib/file.c | 8 ++++++++ lib-lib/file.h | 2 ++ lib-ui/curs_lib.c | 4 ++-- lib-ui/query.c | 2 +- muttlib.c | 8 -------- protos.h | 1 - 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib-lib/file.c b/lib-lib/file.c index 584fcdb..aee3580 100644 --- a/lib-lib/file.c +++ b/lib-lib/file.c @@ -455,6 +455,14 @@ ssize_t m_file_fmt(char *dst, ssize_t n, const char *fmt, const char *src) return pos; } +ssize_t +m_quotefile_fmt(char *dst, ssize_t n, const char *fmt, const char *src) +{ + char tmp[LONG_STRING]; + mutt_quote_filename(tmp, sizeof(tmp), src); + return m_file_fmt(dst, n, fmt, tmp); +} + static ssize_t m_tempftplize(char *dst, ssize_t dlen, const char *fmt, const char *s) { diff --git a/lib-lib/file.h b/lib-lib/file.h index 2e7fb7e..bc153a8 100644 --- a/lib-lib/file.h +++ b/lib-lib/file.h @@ -75,6 +75,8 @@ ssize_t mutt_quote_filename(char *, ssize_t, const char *); /* replace any %s with src, or appends " $src" */ ssize_t m_file_fmt(char *dst, ssize_t n, const char *fmt, const char *src); +ssize_t m_quotefile_fmt(char *, ssize_t, const char *, const char *); + int m_tempfd(char *dst, ssize_t n, const char *dir, const char *fmt); FILE *m_tempfile(char *dst, ssize_t n, const char *dir, const char *fmt); diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index 079a34a..762cfbb 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -145,7 +145,7 @@ void mutt_edit_file (const char *editor, const char *data) char cmd[LONG_STRING]; mutt_endwin (NULL); - mutt_expand_file_fmt (cmd, sizeof (cmd), editor, data); + m_quotefile_fmt(cmd, sizeof (cmd), editor, data); if (mutt_system (cmd) == -1) mutt_error (_("Error running \"%s\"!"), cmd); keypad (stdscr, TRUE); @@ -402,7 +402,7 @@ int mutt_do_pager (const char *banner, char cmd[STRING]; mutt_endwin (NULL); - mutt_expand_file_fmt (cmd, sizeof (cmd), Pager, tempfile); + m_quotefile_fmt(cmd, sizeof (cmd), Pager, tempfile); if (mutt_system (cmd) == -1) { mutt_error (_("Error running \"%s\"!"), cmd); rc = -1; diff --git a/lib-ui/query.c b/lib-ui/query.c index 62ecd9a..b0a42d7 100644 --- a/lib-ui/query.c +++ b/lib-ui/query.c @@ -76,7 +76,7 @@ static QUERY *run_query (char *s, int quiet) int l; - mutt_expand_file_fmt (cmd, sizeof (cmd), QueryCmd, s); + m_quotefile_fmt(cmd, sizeof (cmd), QueryCmd, s); if ((thepid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0) { return 0; diff --git a/muttlib.c b/muttlib.c index 97e650f..87662ec 100644 --- a/muttlib.c +++ b/muttlib.c @@ -233,14 +233,6 @@ void mutt_pretty_mailbox (char *s) } } -void -mutt_expand_file_fmt(char *dst, ssize_t n, const char *fmt, const char *src) -{ - char tmp[LONG_STRING]; - mutt_quote_filename(tmp, sizeof(tmp), src); - m_file_fmt(dst, n, fmt, tmp); -} - /* return 0 on success, -1 on abort, 1 on error */ int mutt_check_overwrite (const char *attname, const char *path, char *fname, ssize_t flen, int *append, diff --git a/protos.h b/protos.h index 570166c..9093cea 100644 --- a/protos.h +++ b/protos.h @@ -67,7 +67,6 @@ void mutt_display_address (ENVELOPE *); void mutt_edit_content_type (HEADER *, BODY *, FILE *); void mutt_edit_headers (const char *, const char *, HEADER *, char *, ssize_t); void mutt_enter_command (void); -void mutt_expand_file_fmt (char *, ssize_t, const char *, const char *); void mutt_fix_reply_recipients (ENVELOPE * env); void mutt_folder_hook (char *); void mutt_forward_intro (FILE * fp, HEADER * cur); -- 2.20.1