[lua] More madmutt package upgrades:
[apps/madmutt.git] / imap / browse.c
index 7cff939..10e9e48 100644 (file)
 
 /* Mutt browser support routines */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <ctype.h>
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/enter.h>
 
-
 #include "mutt.h"
 #include "imap_private.h"
 
@@ -74,7 +63,7 @@ int imap_browse (char *path, struct browser_state *state)
   save_lsub = option (OPTIMAPCHECKSUBSCRIBED);
   unset_option (OPTIMAPCHECKSUBSCRIBED);
   m_strcpy(list_cmd, sizeof(list_cmd),
-           option(OPTIMAPLSUB) ? "LSUB" : "string_list_t");
+           option(OPTIMAPLSUB) ? "LSUB" : "LIST");
 
   if (!(idata = imap_conn_find (&(mx.account), 0)))
     goto fail;
@@ -123,8 +112,7 @@ int imap_browse (char *path, struct browser_state *state)
             mbox[n] = '\0';
           }
         }
-      }
-      while (ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN));
+      } while (m_strncmp(idata->cmd.buf, idata->cmd.seq, SEQLEN));
     }
 
     /* if we're descending a folder, mark it as current in browser_state */
@@ -190,7 +178,7 @@ int imap_browse (char *path, struct browser_state *state)
     /* Listing the home namespace, so INBOX should be included. Home 
      * namespace is not "", so we have to list it explicitly. We ask the 
      * server to see if it has descendants. */
-    if (browse_add_list_result (idata, "string_list_t \"\" \"INBOX\"", state, 0))
+    if (browse_add_list_result (idata, "LIST \"\" \"INBOX\"", state, 0))
       goto fail;
   }
 
@@ -288,7 +276,7 @@ int imap_mailbox_rename (const char *mailbox)
   IMAP_DATA *idata;
   IMAP_MBOX mx;
   char buf[LONG_STRING];
-  char newname[SHORT_STRING];
+  char newname[STRING];
 
   if (imap_parse_path (mailbox, &mx) < 0) {
     return -1;
@@ -357,8 +345,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd,
         imap_add_folder (idata->delim, name, noselect, noinferiors, state,
                          isparent);
     }
-  }
-  while ((ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0));
+  } while ((m_strncmp(idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0));
 
   p_delete(&mx.mbox);
   return 0;
@@ -539,11 +526,11 @@ static int browse_verify_namespace (IMAP_DATA * idata,
      * than invisible namespaces */
     if (nsi->delim)
       snprintf (buf, sizeof (buf), "%s \"\" \"%s%c%%\"",
-                option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", nsi->prefix,
+                option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix,
                 nsi->delim);
     else
       snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"",
-                option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", nsi->prefix);
+                option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix);
 
     imap_cmd_start (idata, buf);
 
@@ -554,8 +541,7 @@ static int browse_verify_namespace (IMAP_DATA * idata,
                                     &nsi->noinferiors, &delim) != 0)
         return -1;
       nsi->listable |= (name != NULL);
-    }
-    while ((ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0));
+    } while ((m_strncmp(idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0));
   }
 
   return 0;