Commit fc68d026 fc68d026ebb7685c6d6d7fd5f7675fcc0aba8c05 by Damien Diederen Committed by Sergey Poznyakoff

maildir: Keep trailing comma even when no flags are set

Without this, `mk_info_filename' generates filenames of the following
form when the flag set is empty:

    1402217787.M664911P5957Q143.hostname:2

The original Maildir spec (http://cr.yp.to/proto/maildir.html),
however, mandates that filenames must be of the form `uniq:info', with
`info' starting with "2,"--including a comma.

This patch removes the "cleanup" performed by `mk_info_filename' as
that there is no rationale for it in mailutils' source code history,
and as it breaks Gnus' "nnmaildir" backend (Cf.  `nnmaildir--add-flag').

* libproto/maildir/mbox.c (mk_info_filename): Keep comma at the end of
filename when the flags suffix is empty.
1 parent 8ad65f75
...@@ -278,9 +278,6 @@ mk_info_filename (char *directory, char *suffix, char *name, int flags) ...@@ -278,9 +278,6 @@ mk_info_filename (char *directory, char *suffix, char *name, int flags)
278 size += 3 + strlen (fbuf); 278 size += 3 + strlen (fbuf);
279 279
280 tmp = malloc (size); 280 tmp = malloc (size);
281 if (!fbuf[0])
282 sprintf (tmp, "%s/%s/%*.*s:2", directory, suffix, namelen, namelen, name);
283 else
284 sprintf (tmp, "%s/%s/%*.*s:2,%s", directory, suffix, namelen, namelen, name, fbuf); 281 sprintf (tmp, "%s/%s/%*.*s:2,%s", directory, suffix, namelen, namelen, name, fbuf);
285 return tmp; 282 return tmp;
286 } 283 }
......