From 2f2b123d716e6749b0e3e263a67280152944b026 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Wed, 16 Jan 2002 22:13:19 +0000 Subject: [PATCH] sync_mailbox() did not update the msg struct when flags were changed, causing the expunge command to fail remove bogus strfcpy() line --- maildir.c | 1 - sync.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/maildir.c b/maildir.c index 01cebb4..d0ad29a 100644 --- a/maildir.c +++ b/maildir.c @@ -278,7 +278,6 @@ maildir_open (const char *path, int flags) /* determine the UID for this message. The basename (sans * flags) is used as the key in the db */ - strfcpy (buf, p->file, sizeof (buf)); key.dptr = p->file; s = strchr (key.dptr, ':'); key.dsize = s ? (size_t) (s - key.dptr) : strlen (key.dptr); diff --git a/sync.c b/sync.c index f0adde2..6120311 100644 --- a/sync.c +++ b/sync.c @@ -220,7 +220,17 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags, (cur->flags & D_DELETED) ? "T" : ""); if (rename (path, newpath)) + { perror ("rename"); + return -1; + } + else + { + /* update the filename in the msg struct */ + p=strrchr(newpath,'/'); + free(cur->file); + cur->file=strdup(p+1); + } } }