Ensure stability of merge sort in assoc
* libmailutils/base/assoc.c (merge): Fix comparison
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -695,7 +695,7 @@ merge (struct _mu_assoc_elem *left, struct _mu_assoc_elem *right, | ... | @@ -695,7 +695,7 @@ merge (struct _mu_assoc_elem *left, struct _mu_assoc_elem *right, |
695 | 695 | ||
696 | while (left && right) | 696 | while (left && right) |
697 | { | 697 | { |
698 | if (cmp (left->name, left->data, right->name, right->data, data) < 0) | 698 | if (cmp (left->name, left->data, right->name, right->data, data) <= 0) |
699 | { | 699 | { |
700 | tmp = left->next; | 700 | tmp = left->next; |
701 | *tailptr = left; | 701 | *tailptr = left; | ... | ... |
-
Please register or sign in to post a comment