From e88297c072e6bfbeaedc1287ec695ca37537255e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 2 Mar 2019 14:10:51 -0400 Subject: [PATCH] lib/string_map: fix return type of string_cmp I can't figure out how checking the sign of a bool ever worked. The following program demonstrates the problem (i.e. for me it prints 1). #include #include int main(int argc, char **argv) { bool x; x = -1; printf("x = %d\n", x); } This seems to be mandated by the C99 standard 6.3.1.2. --- lib/string-map.c | 2 +- test/T610-message-property.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/string-map.c b/lib/string-map.c index ad818207..a88404c7 100644 --- a/lib/string-map.c +++ b/lib/string-map.c @@ -106,7 +106,7 @@ _notmuch_string_map_sort (notmuch_string_map_t *map) map->sorted = true; } -static bool +static int string_cmp (const char *a, const char *b, bool exact) { if (exact) diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh index 04f0c9be..53a0be3b 100755 --- a/test/T610-message-property.sh +++ b/test/T610-message-property.sh @@ -101,7 +101,6 @@ EOF test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "testing string map binary search (via message properties)" -test_subtest_known_broken cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} { char *keys[] = {"a", "b", "c", "d", "e", NULL}; -- 2.43.0