always use compressed mode.
[apps/madmutt.git] / mh.c
diff --git a/mh.c b/mh.c
index bba47ae..a013376 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -308,11 +308,11 @@ void mh_update_sequences (CONTEXT * ctx)
   /* first, copy unknown sequences */
   if ((ofp = fopen (sequences, "r"))) {
     while ((buff = mutt_read_line (buff, &s, ofp, &l))) {
-      if (!str_ncmp (buff, seq_unseen, m_strlen(seq_unseen)))
+      if (!m_strncmp(buff, seq_unseen, m_strlen(seq_unseen)))
         continue;
-      if (!str_ncmp (buff, seq_flagged, m_strlen(seq_flagged)))
+      if (!m_strncmp(buff, seq_flagged, m_strlen(seq_flagged)))
         continue;
-      if (!str_ncmp (buff, seq_replied, m_strlen(seq_replied)))
+      if (!m_strncmp(buff, seq_replied, m_strlen(seq_replied)))
         continue;
 
       fprintf (nfp, "%s\n", buff);
@@ -492,10 +492,10 @@ static void maildir_parse_flags (HEADER * h, const char *path)
   h->read = 0;
   h->replied = 0;
 
-  if ((p = strrchr (path, ':')) != NULL && str_ncmp (p + 1, "2,", 2) == 0) {
+  if ((p = strrchr (path, ':')) != NULL && m_strncmp(p + 1, "2,", 2) == 0) {
     p += 3;
 
-    str_replace (&h->maildir_flags, p);
+    m_strreplace(&h->maildir_flags, p);
     q = h->maildir_flags;
 
     while (*p) {
@@ -550,7 +550,7 @@ static void maildir_update_mtime (CONTEXT * ctx)
     if (stat (buf, &st) == 0)
       ctx->mtime_cur = st.st_mtime;
 
-    strfcpy (buf, ctx->path, sizeof (buf));
+    m_strcpy(buf, sizeof(buf), ctx->path);
   }
 
   if (stat (buf, &st) == 0)
@@ -690,7 +690,7 @@ static int maildir_parse_dir (CONTEXT * ctx, struct maildir ***last,
     is_old = (m_strcmp("cur", subdir) == 0);
   }
   else
-    strfcpy (buf, ctx->path, sizeof (buf));
+    m_strcpy(buf, sizeof(buf), ctx->path);
 
   if ((dirp = opendir (buf)) == NULL)
     return -1;
@@ -1044,9 +1044,9 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr
     *suffix = '\0';
 
   if (hdr && (hdr->read || hdr->old))
-    strfcpy (subdir, "cur", sizeof (subdir));
+    m_strcpy(subdir, sizeof(subdir), "cur");
   else
-    strfcpy (subdir, "new", sizeof (subdir));
+    m_strcpy(subdir, sizeof(subdir), "new");
 
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
@@ -1115,11 +1115,11 @@ static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr)
 
   /* extract the subdir */
   s = strrchr (msg->path, '/') + 1;
-  strfcpy (subdir, s, 4);
+  m_strcpy(subdir, sizeof(subdir), s);
 
   /* extract the flags */
   if ((s = strchr (s, ':')))
-    strfcpy (suffix, s, sizeof (suffix));
+    m_strcpy(suffix, sizeof(suffix), s);
   else
     suffix[0] = '\0';
 
@@ -1134,7 +1134,7 @@ static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr)
 
     if (safe_rename (msg->path, full) == 0) {
       if (hdr)
-        str_replace (&hdr->path, path);
+        m_strreplace(&hdr->path, path);
       p_delete(&msg->path);
 
       /*
@@ -1220,7 +1220,7 @@ static int _mh_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr,
     snprintf (path, sizeof (path), "%s/%s", ctx->path, tmp);
     if (safe_rename (msg->path, path) == 0) {
       if (hdr)
-        str_replace (&hdr->path, tmp);
+        m_strreplace(&hdr->path, tmp);
       p_delete(&msg->path);
       break;
     }
@@ -1266,8 +1266,8 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno)
   if ((rc = mutt_copy_message (dest->fp, ctx, h,
                                M_CM_UPDATE, CH_UPDATE | CH_UPDATE_LEN)) == 0)
   {
-    snprintf (oldpath, _POSIX_PATH_MAX, "%s/%s", ctx->path, h->path);
-    strfcpy (partpath, h->path, _POSIX_PATH_MAX);
+    snprintf (oldpath, sizeof(oldpath), "%s/%s", ctx->path, h->path);
+    m_strcpy(partpath, sizeof(partpath), h->path);
 
     if (ctx->magic == M_MAILDIR)
       rc = maildir_commit_message (dest, ctx, h);
@@ -1299,7 +1299,7 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno)
     if (ctx->magic == M_MH && rc == 0) {
       snprintf (newpath, _POSIX_PATH_MAX, "%s/%s", ctx->path, h->path);
       if ((rc = safe_rename (newpath, oldpath)) == 0)
-        str_replace (&h->path, partpath);
+        m_strreplace(&h->path, partpath);
     }
   }
   else
@@ -1352,7 +1352,7 @@ static int maildir_sync_message (CONTEXT * ctx, int msgno)
       return (-1);
     }
     p++;
-    strfcpy (newpath, p, sizeof (newpath));
+    m_strcpy(newpath, sizeof(newpath), p);
 
     /* kill the previous flags */
     if ((p = strchr (newpath, ':')) != NULL)
@@ -1377,7 +1377,7 @@ static int maildir_sync_message (CONTEXT * ctx, int msgno)
       mutt_perror ("rename");
       return (-1);
     }
-    str_replace (&h->path, partpath);
+    m_strreplace(&h->path, partpath);
   }
   return (0);
 }
@@ -1482,7 +1482,7 @@ static char *maildir_canon_filename (char *dest, const char *src, size_t l)
   if ((t = strrchr (src, '/')))
     src = t + 1;
 
-  strfcpy (dest, src, l);
+  m_strcpy(dest, l, src);
   if ((u = strrchr (dest, ':')))
     *u = '\0';
 
@@ -1631,7 +1631,7 @@ static int maildir_check_mailbox (CONTEXT * ctx, int *index_hint, int unused)
        * subdirectory.  If so, update the associated filename.
        */
       if (m_strcmp(ctx->hdrs[i]->path, p->h->path))
-        str_replace (&ctx->hdrs[i]->path, p->h->path);
+        m_strreplace(&ctx->hdrs[i]->path, p->h->path);
 
       /* if the user hasn't modified the flags on this message, update
        * the flags we just detected.
@@ -1708,7 +1708,7 @@ static int mh_check_mailbox (CONTEXT * ctx, int *index_hint, int unused)
   if (!option (OPTCHECKNEW))
     return 0;
 
-  strfcpy (buf, ctx->path, sizeof (buf));
+  m_strcpy(buf, sizeof(buf), ctx->path);
   if (stat (buf, &st) == -1)
     return -1;