X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fstring-map.c;h=ad818207f5d4a91450336a99af2518ffcd2b8bc3;hb=HEAD;hp=e3a81b4fe1457a030154fb3cb05cfc59cd3bb059;hpb=9d6f4641d17a6100cb8d96bc1e09d3d4999c34f3;p=notmuch diff --git a/lib/string-map.c b/lib/string-map.c index e3a81b4f..99bc2ea2 100644 --- a/lib/string-map.c +++ b/lib/string-map.c @@ -86,10 +86,14 @@ _notmuch_string_map_append (notmuch_string_map_t *map, 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