File cyrus-imapd_references_header-dos.dif of Package cyrus-imapd.import5240

Index: cyrus-imapd-2.3.17/imap/index.c
===================================================================
--- cyrus-imapd-2.3.17.orig/imap/index.c
+++ cyrus-imapd-2.3.17/imap/index.c
@@ -192,6 +192,7 @@ static void index_thread_orderedsubj(uns
 static void index_thread_sort(Thread *root, struct sortcrit *sortcrit);
 static void index_thread_print(Thread *threads, int usinguid);
 static void index_thread_ref(unsigned *msgno_list, int nmsg, int usinguid);
+static void massage_header(char *hdr);
 
 /* NOTE: Make sure these are listed in CAPABILITY_STRING */
 static const struct thread_algorithm thread_algs[] = {
@@ -4132,6 +4133,7 @@ void index_get_ids(MsgData *msgdata, cha
 	/* allocate some space for refs */
 	msgdata->ref = (char **) xmalloc(refsize * sizeof(char *));
 	/* find references */
+	massage_header(buf);
 	refstr = buf;
 	while ((ref = find_msgid(refstr, &refstr)) != NULL) {
 	    /* reallocate space for this msgid if necessary */