The name of the AS has not been converted to lowercase
before which causes that we didn't find all ASes.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
int loc_as_match_string(struct loc_as* as, const char* string) {
- int r = 1;
-
- char* name = strdup(as->name);
-
- // Convert string to lowercase
- for (char* p = name; *p; p++)
- *p = tolower(*p);
-
// Search if string is in name
- if (strstr(as->name, string) != NULL)
- r = 0;
+ if (strcasestr(as->name, string) != NULL)
+ return 1;
- free(name);
- return r;
+ return 0;
}
return NULL;
r = loc_as_match_string(as, enumerator->string);
- if (r == 0) {
+ if (r == 1) {
DEBUG(enumerator->ctx, "AS%d (%s) matches %s\n",
loc_as_get_number(as), loc_as_get_name(as), enumerator->string);