X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=mh.c;h=da270a25bc16a8bc23afa6f4e9bed945a86e9e2f;hb=c98480f8568e6c1bc927c6c5f2b5e80b4aa6548c;hp=8f40b397833c4f1fd155011559f4164a48332874;hpb=2ea77d3b2827ba23feb756ce2fb936565ae38998;p=apps%2Fmadmutt.git diff --git a/mh.c b/mh.c index 8f40b39..da270a2 100644 --- a/mh.c +++ b/mh.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "mutt.h" #include "mx.h" @@ -200,7 +201,7 @@ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) int fd; char path[_POSIX_PATH_MAX]; - FOREVER { + for (;;) { snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d", dest->path, NONULL (Hostname), (int) getpid (), Counter++); umask (Umask); @@ -307,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); @@ -491,7 +492,7 @@ 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); @@ -1047,7 +1048,7 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr else strfcpy (subdir, "new", sizeof (subdir)); - FOREVER { + for (;;) { snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s", dest->path, subdir, (long) time (NULL), (unsigned int) getpid (), Counter++, NONULL (Hostname), suffix); @@ -1123,7 +1124,7 @@ static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr) suffix[0] = '\0'; /* construct a new file name. */ - FOREVER { + for (;;) { snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir, (long) time (NULL), (unsigned int) getpid (), Counter++, NONULL (Hostname), suffix); @@ -1213,7 +1214,7 @@ static int _mh_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr, * slot. */ - FOREVER { + for (;;) { hi++; snprintf (tmp, sizeof (tmp), "%d", hi); snprintf (path, sizeof (path), "%s/%s", ctx->path, tmp);