changeset: 6570:90d0935c3142
user: Kevin McCarthy <[email protected]>
date: Sun Mar 13 11:19:47 2016 -0700
link: http://dev.mutt.org/hg/mutt/rev/90d0935c3142
Fix RFC2231 continuation join order. (closes #3811) (closes #3741)
The function generating a list of parts to join had incorrect sorting
logic. It was comparing values, not attributes. Additionally, the
order logic wasn't correct.
Thanks to TAKAHASHI Tamotsu for pointing out the value vs attribute
comparison bug.
diffs (31 lines):
diff -r bd0e695f627e -r 90d0935c3142 rfc2231.c
--- a/rfc2231.c Fri Mar 11 13:47:29 2016 +0100
+++ b/rfc2231.c Sun Mar 13 11:19:47 2016 -0700
@@ -239,19 +239,19 @@
struct rfc2231_parameter *par)
{
struct rfc2231_parameter **last = list;
- struct rfc2231_parameter *p = *list, *q;
+ struct rfc2231_parameter *p = *list;
int c;
-
+
while (p)
{
+ c = strcmp (par->attribute, p->attribute);
+ if ((c < 0) || (c == 0 && par->index <= p->index))
+ break;
+
last = &p->next;
- q = p; p = p->next;
+ p = p->next;
+ }
- c = strcmp (par->value, q->value);
- if ((c > 0) || (c == 0 && par->index >= q->index))
- break;
- }
-
par->next = p;
*last = par;
}