From: epg <> Date: Thu, 13 Apr 2006 01:44:31 +0000 (+0000) Subject: Use an actual maildir called spam, not simply a subdir beside 'new'. X-Git-Url: https://diplodocus.org/git/mdeliver/commitdiff_plain/654d4bd3209320785309d4175ea99c65ffb7383c?ds=inline Use an actual maildir called spam, not simply a subdir beside 'new'. --- diff --git a/processor.c b/processor.c index f9bf73f..2c015c6 100644 --- a/processor.c +++ b/processor.c @@ -161,13 +161,17 @@ process(char *tmp) { size_t len = strlen(tmp); errfn = malloc(len + 1); - /* +2 because this one has an extra char ("mdp" vs. "spam"). */ - char *new = malloc(len + 2); + /* 5 for spam/ and 1 for terminating null */ + char *new = malloc(len + 5 + 1); strcpy(errfn, "err"); strcat(errfn, tmp + 3); - strcpy(new, is_spam(tmp) ? "spam" : "new"); + new[0] = '\0'; + if (is_spam(tmp)) { + strcpy(new, "spam/"); + } + strcat(new, "new"); strcat(new, tmp + 3); if (rename(tmp, new) == -1) {