Before, both "xY_z" and "xy-z" were considered equally good matches for
"xy-z", but obviously the latter is a much better match. This commit fixes
the problem (which was found by inspection).
{
int score;
+ if (!strcmp(name, s)) {
+ return UINT_MAX;
+ }
for (score = 0; ; score++, name++, s++) {
if (to_lower_and_underscores(*name) != to_lower_and_underscores(*s)) {
break;
} else if (*name == '\0') {
- return UINT_MAX;
+ return UINT_MAX - 1;
}
}
return *s == '\0' ? score : 0;