]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: Write only base filenames to uidlist.
authorTimo Sirainen <tss@iki.fi>
Wed, 6 Oct 2010 18:19:48 +0000 (19:19 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 6 Oct 2010 18:19:48 +0000 (19:19 +0100)
Previously the old filename was used to guess the initial filename, but
nowadays we do that by building the filename based on flags in index.

src/lib-storage/index/maildir/maildir-uidlist.c

index 09cf05110798a04790c015e454c9b6b91e0e30cd..3e69b3eebb2de7fb3d6372fb9e4efc8b1b02dc42 100644 (file)
@@ -1234,6 +1234,7 @@ static int maildir_uidlist_write_fd(struct maildir_uidlist *uidlist, int fd,
        struct maildir_uidlist_rec *rec;
        string_t *str;
        const unsigned char *p;
+       const char *strp;
        unsigned int len;
        int ret;
 
@@ -1285,7 +1286,13 @@ static int maildir_uidlist_write_fd(struct maildir_uidlist *uidlist, int fd,
                                p += len + 1;
                        }
                }
-               str_printfa(str, " :%s\n", rec->filename);
+               str_append(str, " :");
+               strp = strchr(rec->filename, ':');
+               if (strp == NULL)
+                       str_append(str, rec->filename);
+               else
+                       str_append_n(str, rec->filename, strp - rec->filename);
+               str_append_c(str, '\n');
                o_stream_send(output, str_data(str), str_len(str));
        }
        maildir_uidlist_iter_deinit(&iter);