summaryrefslogtreecommitdiffstats
path: root/mh.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-09-22 18:13:12 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-09-22 18:13:12 +0000
commit44716e861e9c38c6771d2605e3c3b9db7ecc145a (patch)
treec9ecbf1d698fb4c9af56d0b0040e957fe9b4d09c /mh.c
parent940f31f67ffe4ec651c099c9bcd62b78d1189cc9 (diff)
Some fixes and code clean-ups.
Diffstat (limited to 'mh.c')
-rw-r--r--mh.c65
1 files changed, 37 insertions, 28 deletions
diff --git a/mh.c b/mh.c
index b8a90132..f880a9d8 100644
--- a/mh.c
+++ b/mh.c
@@ -34,6 +34,42 @@
#include <errno.h>
#include <string.h>
+static void maildir_parse_flags(HEADER *h)
+{
+ char *p;
+
+ h->flagged = 0;
+ h->read = 0;
+ h->replied = 0;
+
+ if ((p = strchr (h->path, ':')) != NULL && strncmp (p + 1, "2,", 2) == 0)
+ {
+ p += 3;
+ while (*p)
+ {
+ switch (*p)
+ {
+ case 'F':
+
+ h->flagged = 1;
+ break;
+
+ case 'S': /* seen */
+
+ h->read = 1;
+ break;
+
+ case 'R': /* replied */
+
+ h->replied = 1;
+ break;
+ }
+ p++;
+ }
+ }
+}
+
+
void mh_parse_message (CONTEXT *ctx,
const char *subdir,
const char *fname,
@@ -41,7 +77,6 @@ void mh_parse_message (CONTEXT *ctx,
int isOld)
{
char path[_POSIX_PATH_MAX];
- char *p;
FILE *f;
HEADER *h;
struct stat st;
@@ -95,34 +130,8 @@ void mh_parse_message (CONTEXT *ctx,
*/
h->old = isOld;
-
- if ((p = strchr (h->path, ':')) != NULL && strncmp (p + 1, "2,", 2) == 0)
- {
- p += 3;
- while (*p)
- {
- switch (*p)
- {
- case 'F':
-
- h->flagged = 1;
- break;
-
- case 'S': /* seen */
-
- h->read = 1;
- break;
-
- case 'R': /* replied */
-
- h->replied = 1;
- break;
- }
- p++;
- }
- }
+ maildir_parse_flags(h);
}
-
/* set flags and update context info */
mx_update_context (ctx);
}