mutt_expand_file_fmt -> m_quotefile_fmt in file.c
authorPierre Habouzit <madcoder@debian.org>
Sun, 26 Nov 2006 16:31:33 +0000 (17:31 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 26 Nov 2006 16:31:33 +0000 (17:31 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
lib-lib/file.c
lib-lib/file.h
lib-ui/curs_lib.c
lib-ui/query.c
muttlib.c
protos.h

index 584fcdb..aee3580 100644 (file)
@@ -455,6 +455,14 @@ ssize_t m_file_fmt(char *dst, ssize_t n, const char *fmt, const char *src)
     return pos;
 }
 
     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)
 {
 static ssize_t
 m_tempftplize(char *dst, ssize_t dlen, const char *fmt, const char *s)
 {
index 2e7fb7e..bc153a8 100644 (file)
@@ -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);
 
 /* 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);
 
 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);
 
index 079a34a..762cfbb 100644 (file)
@@ -145,7 +145,7 @@ void mutt_edit_file (const char *editor, const char *data)
   char cmd[LONG_STRING];
 
   mutt_endwin (NULL);
   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);
   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);
     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;
     if (mutt_system (cmd) == -1) {
       mutt_error (_("Error running \"%s\"!"), cmd);
       rc = -1;
index 62ecd9a..b0a42d7 100644 (file)
@@ -76,7 +76,7 @@ static QUERY *run_query (char *s, int quiet)
   int l;
 
 
   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;
 
   if ((thepid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0) {
     return 0;
index 97e650f..87662ec 100644 (file)
--- 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,
 /* 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,
index 570166c..9093cea 100644 (file)
--- 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_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);
 void mutt_fix_reply_recipients (ENVELOPE * env);
 void mutt_folder_hook (char *);
 void mutt_forward_intro (FILE * fp, HEADER * cur);