make m_dupstr return NULL if the string was empty.
[apps/madmutt.git] / imap / imap.c
index 3945456..2a4feca 100644 (file)
@@ -18,9 +18,9 @@
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
+#include <lib-lib/buffer.h>
 
 #include "mutt.h"
-#include "buffer.h"
 #include "mx.h"
 #include "globals.h"
 #include "sort.h"
@@ -785,12 +785,13 @@ int imap_close_connection (CONTEXT *ctx)
 
 /* imap_set_flag: append str to flags if we currently have permission
  *   according to aclbit */
-static void imap_set_flag (IMAP_DATA * idata, int aclbit, int flag,
-                           const char *str, char *flags, size_t flsize)
+static void imap_set_flag(IMAP_DATA *idata, int aclbit, int flag,
+                          const char *str, char *flags, size_t flsize)
 {
-  if (mutt_bit_isset (idata->rights, aclbit))
-    if (flag)
-      str_cat (flags, flsize, str);
+    if (mutt_bit_isset(idata->rights, aclbit)) {
+        if (flag)
+            m_strcat(flags, flsize, str);
+    }
 }
 
 /* imap_make_msg_set: make an IMAP4rev1 UID message set out of a set of
@@ -1181,7 +1182,7 @@ int imap_mailbox_check (char *path, int new)
    * command on a mailbox that you have selected 
    */
 
-  if (str_cmp (mbox_unquoted, idata->mailbox) == 0
+  if (m_strcmp(mbox_unquoted, idata->mailbox) == 0
       || (ascii_strcasecmp (mbox_unquoted, "INBOX") == 0
           && str_casecmp (mbox_unquoted, idata->mailbox) == 0)) {
     strfcpy (buf, "NOOP", sizeof (buf));