EBookBackendSqliteDB: Fixed an inconsistency in phone number matches.
authorTristan Van Berkom <tristanvb@openismus.com>
Thu, 3 Oct 2013 22:04:14 +0000 (00:04 +0200)
committerTristan Van Berkom <tristanvb@openismus.com>
Sat, 19 Oct 2013 18:55:12 +0000 (20:55 +0200)
The phone number national number matching algoritm was hard coding
the country code length to 2, causing some random results.

addressbook/libedata-book/e-book-backend-sqlitedb.c

index 7792962..3138319 100644 (file)
@@ -1207,7 +1207,7 @@ ixphone_compare_national (gpointer data,
                        if (sep2 != str2)
                                cmp = e_strcmp2n (country_code, strlen (country_code), str2, sep2 - str2);
                } else if (sep2 == str2) {
-                       cmp = e_strcmp2n (str1, sep1 - str1, country_code, 2);
+                       cmp = e_strcmp2n (str1, sep1 - str1, country_code, strlen (country_code));
                } else {
                        /* Also compare the country code if the national number
                         * matches and both numbers have a country code. */