summaryrefslogtreecommitdiffstats
path: root/mh.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-09-22 17:50:26 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-09-22 17:50:26 +0000
commit940f31f67ffe4ec651c099c9bcd62b78d1189cc9 (patch)
tree40d83b81a06f6bd1fb41c093862fd65da3eadb67 /mh.c
parentcc34e4308f01326cea9bd30169520c6f4bf8a12e (diff)
Introduce the $mh_purge option.
Diffstat (limited to 'mh.c')
-rw-r--r--mh.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mh.c b/mh.c
index 3ea7f158..b8a90132 100644
--- a/mh.c
+++ b/mh.c
@@ -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)