commit-mailutils
[Top][All Lists]
Advanced

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

[SCM] GNU Mailutils branch, master, updated. rel-2_1-29-g68447ef


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. rel-2_1-29-g68447ef
Date: Wed, 27 Jan 2010 21:07:13 +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=68447ef06f4752ebaf1d47e4f93d2791153459c9

The branch, master has been updated
       via  68447ef06f4752ebaf1d47e4f93d2791153459c9 (commit)
      from  c0e1fc828e69eceb34fab770b888cce3843c6e7f (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 68447ef06f4752ebaf1d47e4f93d2791153459c9
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Jan 27 23:09:15 2010 +0200

    MH-related bugfixes.
    
    * mailbox/mbx_default.c (plus_expand): Do not treat the part
    between initial + and / as user name.
    * mh/mh_format.c (print_fmt_segment): New function.
    (print_fmt_string): Correctly handle multi-line inputs.

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

Summary of changes:
 mailbox/mbx_default.c |   33 +++++++++------------------------
 mh/mh_format.c        |   21 ++++++++++++++++++---
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/mailbox/mbx_default.c b/mailbox/mbx_default.c
index a03e9ea..e135a82 100644
--- a/mailbox/mbx_default.c
+++ b/mailbox/mbx_default.c
@@ -268,45 +268,30 @@ user_mailbox_name (const char *user, char **mailbox_name)
 static int
 plus_expand (const char *file, char **buf)
 {
-  char *user = NULL;
-  char *path = NULL;
   char *home;
   const char *folder_dir = mu_folder_directory ();
   int status, len;
-  
-  if ((status = split_shortcut (file, "+=", &path, &user)))
-    return status;
 
-  if (!path)
-    {
-      free (user);
-      return ENOENT;
-    }
-  
-  home = get_homedir (user);
+  home = get_homedir (NULL);
   if (!home)
-    {
-      free (user);
-      free (path);
-      return ENOENT;
-    }
-
+    return ENOENT;
+  
+  file++;
+  
   if (folder_dir[0] == '/' || mu_is_proto (folder_dir))
     {
-      len = strlen (folder_dir) + strlen (path) + 2;
+      len = strlen (folder_dir) + strlen (file) + 2;
       *buf = malloc (len);
-      sprintf (*buf, "%s/%s", folder_dir, path);
+      sprintf (*buf, "%s/%s", folder_dir, file);
     }
   else
     {
-      len = strlen (home) + strlen (folder_dir) + strlen (path) + 3;
+      len = strlen (home) + strlen (folder_dir) + strlen (file) + 3;
       *buf = malloc (len);
-      sprintf (*buf, "%s/%s/%s", home, folder_dir, path);
+      sprintf (*buf, "%s/%s/%s", home, folder_dir, file);
     }
   (*buf)[len-1] = 0;
   
-  free (user);
-  free (path);
   free (home);
   return 0;
 }
diff --git a/mh/mh_format.c b/mh/mh_format.c
index 868bb85..a804667 100644
--- a/mh/mh_format.c
+++ b/mh/mh_format.c
@@ -321,10 +321,10 @@ print_string (struct mh_machine *mach, size_t width, char 
*str)
 }
   
 static void
-print_fmt_string (struct mh_machine *mach, size_t fmtwidth, char *str)
+print_fmt_segment (struct mh_machine *mach, size_t fmtwidth, char *str,
+                  size_t len)
 {
-  size_t len = strlen (str);
-  size_t width = mbslen (str);
+  size_t width = mbsnlen (str, len);
 
   if (fmtwidth && width > fmtwidth)
     {
@@ -346,6 +346,21 @@ print_fmt_string (struct mh_machine *mach, size_t 
fmtwidth, char *str)
 }
 
 static void
+print_fmt_string (struct mh_machine *mach, size_t fmtwidth, char *str)
+{
+  char *p = strchr (str, '\n');
+  while (p)
+    {
+      print_fmt_segment (mach, fmtwidth, str, p - str + 1);
+      mach->ind = 0;
+      str = p + 1;
+      p = strchr (str, '\n');
+    }
+  if (str[0])
+    print_fmt_segment (mach, fmtwidth, str, strlen (str));
+}
+
+static void
 reset_fmt_defaults (struct mh_machine *mach)
 {
   const char *p;


hooks/post-receive
-- 
GNU Mailutils




reply via email to

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