diff options
author | mvglasow <michael -at- vonglasow.com> | 2018-02-03 01:23:05 +0100 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2018-02-03 01:23:05 +0100 |
commit | 53da6dfd039084039bcc8fad11c09ba3d3abbaf9 (patch) | |
tree | d543d97627dcf5c8f242531777fa43feb7fe092c /navit/util.c | |
parent | ba71fb3967fefa94f08381c1d0f48fd24a64e6a1 (diff) | |
download | navit-53da6dfd039084039bcc8fad11c09ba3d3abbaf9.tar.gz |
Add:core:improve compare_name_systematic()
Case-insensitive, honors separators
Signed-off-by: mvglasow <michael -at- vonglasow.com>
Diffstat (limited to 'navit/util.c')
-rw-r--r-- | navit/util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/navit/util.c b/navit/util.c index fb8d3ee00..907edf636 100644 --- a/navit/util.c +++ b/navit/util.c @@ -122,11 +122,9 @@ static char * parse_for_systematic_comparison(const char *s) { dbg(lvl_debug, "enter\n"); - // TODO convert strings to lowercase - while (i < strlen(in)) { c = in[i]; - if (c <= 0x20) { + if ((c <= 0x20) || (c == ',') || (c == '-') || (c == '.') || (c == '/')) { /* whitespace */ if (state == parse_state_numeric) { part = g_malloc0(i + 1); @@ -245,7 +243,7 @@ int compare_name_systematic(const char *s1, const char *s2) { if (atoi(r) || (r[0] == '0')) ret = 1; else - ret = strcmp(l, r); + ret = strcasecmp(l, r); } l += strlen(l) + 1; |