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-3.1.1-48-g0910546


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-3.1.1-48-g0910546
Date: Sun, 22 Jan 2017 22:35:01 +0000 (UTC)

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=091054679e9842c2b96b3ee7e4ff5b59f8e0f9ee

The branch, master has been updated
       via  091054679e9842c2b96b3ee7e4ff5b59f8e0f9ee (commit)
      from  50979073a80a6a993c8824d32ad6ebf1e4a72e63 (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 091054679e9842c2b96b3ee7e4ff5b59f8e0f9ee
Author: Sergey Poznyakoff <address@hidden>
Date:   Mon Jan 23 00:30:42 2017 +0200

    Fix listing names with escapable characters
    
    * imap4d/io.c (io_send_qstring): Fix condition
    * imap4d/list.c (list_fun): Use io_send_qstring to print names.
    * imap4d/lsub.c (imap4d_lsub): Likewise.

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

Summary of changes:
 imap4d/io.c   |    5 ++---
 imap4d/list.c |    5 ++++-
 imap4d/lsub.c |    8 ++++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/imap4d/io.c b/imap4d/io.c
index 1eaf601..dc32d25 100644
--- a/imap4d/io.c
+++ b/imap4d/io.c
@@ -234,15 +234,14 @@ io_sendf (const char *format, ...)
 }
 
 /* Send NIL if empty string, change the quoted string to a literal if the
-   string contains: double quotes, CR, LF, and '/'.  CR, LF will be changed
+   string contains: double quotes, CR, LF, and '\\'.  CR, LF will be changed
    to spaces.  */
 int
 io_send_qstring (const char *buffer)
 {
   if (buffer == NULL || *buffer == '\0')
     return io_sendf ("NIL");
-  if (strchr (buffer, '"') || strchr (buffer, '\r') || strchr (buffer, '\n')
-      || strchr (buffer, '\\'))
+  if (strpbrk (buffer, "\"\r\n\\"))
     {
       char *s;
       int ret;
diff --git a/imap4d/list.c b/imap4d/list.c
index 31f4032..52456eb 100644
--- a/imap4d/list.c
+++ b/imap4d/list.c
@@ -93,7 +93,10 @@ list_fun (mu_folder_t folder, struct mu_list_response *resp, 
void *data)
   else if (is_atom (name))
     io_sendf ("%s\n", name);
   else
-    io_sendf ("\"%s\"\n", name);
+    {
+      io_send_qstring (name);
+      io_sendf ("\n", name);
+    }
   return 0;
 }
 
diff --git a/imap4d/lsub.c b/imap4d/lsub.c
index f921537..13fc9b2 100644
--- a/imap4d/lsub.c
+++ b/imap4d/lsub.c
@@ -65,8 +65,12 @@ imap4d_lsub (struct imap4d_session *session,
          mu_iterator_current_kv (itr, (const void **)&name, (void**)&val);
 
          if (mu_imap_wildmatch (pattern, name, MU_HIERARCHY_DELIMITER) == 0)
-           io_untagged_response (RESP_NONE, "LSUB () \"%c\" \"%s\"",
-                                 MU_HIERARCHY_DELIMITER, name);
+           {
+             mu_stream_printf (iostream, "* LSUB () \"%c\" ",
+                               MU_HIERARCHY_DELIMITER);
+             io_send_qstring (name);
+             io_sendf ("\n");
+           }
        }
     }
   else


hooks/post-receive
-- 
GNU Mailutils



reply via email to

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