commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-226-g37e95da


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-226-g37e95da
Date: Thu, 25 Nov 2010 21:42:08 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=37e95daa73d9f2b757ae77f132fb81c08f9e29c6

The branch, master has been updated
       via  37e95daa73d9f2b757ae77f132fb81c08f9e29c6 (commit)
      from  9df638667be69868851e0882eb172b1476ff962d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 37e95daa73d9f2b757ae77f132fb81c08f9e29c6
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Nov 25 23:31:42 2010 +0200

    mhn: implement mhn-suffix-<type> profile component.
    
    * mh/mhn.c (_mhn_profile_get): All arguments are const.
    (mhn_tempfile_name): New function.
    (mhn_show_command): Use mhn_tempfile_name.

-----------------------------------------------------------------------

Summary of changes:
 mh/mhn.c |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/mh/mhn.c b/mh/mhn.c
index 69aa832..cf80736 100644
--- a/mh/mhn.c
+++ b/mh/mhn.c
@@ -576,7 +576,8 @@ msg_part_subpart (msg_part_t p, int level)
 /* *********************** Context file accessors ************************* */
 
 const char *
-_mhn_profile_get (char *prefix, char *type, char *subtype, char *defval)
+_mhn_profile_get (const char *prefix, const char *type, const char *subtype,
+                 const char *defval)
 {
   char *name;
   const char *str;
@@ -670,6 +671,26 @@ mhn_compose_command (char *typestr, int *flags, char *file)
   return (char*) str;
 }
 
+static void
+mhn_tempfile_name (char **tempfile, const char *type, const char *subtype)
+{
+  struct mu_tempfile_hints hints;
+  int flags = 0, rc;
+  const char *s = _mhn_profile_get ("suffix", type, subtype, NULL);;
+  
+  if (s)
+    {
+      hints.suffix = (char*) s;
+      flags |= MU_TEMPFILE_SUFFIX;
+    }
+  rc = mu_tempfile (&hints, flags, NULL, tempfile);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_tempfile", NULL, rc);
+      exit (1);
+    }
+}
+
 char *
 mhn_show_command (mu_message_t msg, msg_part_t part, int *flags,
                  char **tempfile)
@@ -722,7 +743,7 @@ mhn_show_command (mu_message_t msg, msg_part_t part, int 
*flags,
            case 'f':
              /* filename containing content */
              if (!*tempfile)
-               *tempfile = mu_tempname (NULL);
+               mhn_tempfile_name (tempfile, type, subtype);
              obstack_grow (&stk, *tempfile, strlen (*tempfile));
              break;
                                     
@@ -730,7 +751,7 @@ mhn_show_command (mu_message_t msg, msg_part_t part, int 
*flags,
              /* %e, %f, and stdin is terminal not content */
              *flags |= MHN_STDIN|MHN_EXCLUSIVE_EXEC;
              if (!*tempfile)
-               *tempfile = mu_tempname (NULL);
+               mhn_tempfile_name (tempfile, type, subtype);
              obstack_grow (&stk, *tempfile, strlen (*tempfile));
              break;
              
@@ -1318,7 +1339,8 @@ mhn_run_command (mu_message_t msg, msg_part_t part,
          return ENOSYS;
        }
 
-      rc = mu_file_stream_create (&tmp, tempfile, MU_STREAM_RDWR);
+      rc = mu_file_stream_create (&tmp, tempfile,
+                                 MU_STREAM_RDWR|MU_STREAM_CREAT);
       if (rc)
        {
          mu_error (_("cannot create temporary stream (file %s): %s"),


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]