static int
cmppair (const void *pa, const void *pb)
{
+ int cmp = 0;
notmuch_string_pair_t *a = (notmuch_string_pair_t *) pa;
notmuch_string_pair_t *b = (notmuch_string_pair_t *) pb;
- return strcmp (a->key, b->key);
+ cmp = strcmp (a->key, b->key);
+ if (cmp == 0)
+ cmp = strcmp (a->value, b->value);
+ return cmp;
}
static void
_notmuch_string_map_sort (map);
pair = bsearch_first (map->pairs, map->length, key, true);
if (! pair)
- _notmuch_string_map_append (map, key, val);
+ _notmuch_string_map_append (map, key, val);
else {
- talloc_free (pair->value);
- pair->value = talloc_strdup (map->pairs, val);
+ talloc_free (pair->value);
+ pair->value = talloc_strdup (map->pairs, val);
}
}