diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-22 17:50:26 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-22 17:50:26 +0000 |
commit | 940f31f67ffe4ec651c099c9bcd62b78d1189cc9 (patch) | |
tree | 40d83b81a06f6bd1fb41c093862fd65da3eadb67 /mh.c | |
parent | cc34e4308f01326cea9bd30169520c6f4bf8a12e (diff) |
Introduce the $mh_purge option.
Diffstat (limited to 'mh.c')
-rw-r--r-- | mh.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -131,7 +131,7 @@ void mh_parse_message (CONTEXT *ctx, /* * Mark all the mails in ctx read. */ -void tag_all_read (CONTEXT * ctx) +static void tag_all_read (CONTEXT * ctx) { int i; @@ -148,7 +148,7 @@ void tag_all_read (CONTEXT * ctx) /* * Mark one mail as unread */ -int tag_unread (CONTEXT * ctx, char *name) +static int tag_unread (CONTEXT * ctx, char *name) { int i; @@ -621,14 +621,18 @@ int mh_sync_mailbox (CONTEXT * ctx) if (ctx->hdrs[i]->deleted) { snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path); - if (ctx->magic == M_MAILDIR) + if (ctx->magic == M_MAILDIR || (option (OPTMHPURGE) && ctx->magic == M_MH)) unlink (path); - else + else if (ctx->magic == M_MH) { /* MH just moves files out of the way when you delete them */ - snprintf (tmp, sizeof (tmp), "%s/,%s", ctx->path, ctx->hdrs[i]->path); - unlink (tmp); - rename (path, tmp); + if(*ctx->hdrs[i]->path != ',') + { + snprintf (tmp, sizeof (tmp), "%s/,%s", ctx->path, ctx->hdrs[i]->path); + unlink (tmp); + rename (path, tmp); + } + } } else if (ctx->hdrs[i]->changed || ctx->hdrs[i]->attach_del) |