const struct sing_plur *sp;
const char *same, *other, *const *as;
int al;
+ int baselen = strlen(basestr);
for (as = as_is; *as; ++as) {
al = (int) strlen(*as);
}
/* skip "ox" -> "oxen" entry when pluralizing "<something>ox"
unless it is muskox */
- if (to_plural && strlen(basestr) > 2 && !strcmpi(endstring - 2, "ox")
- && strcmpi(endstring - 6, "muskox")) {
+ if (to_plural && baselen > 2 && !strcmpi(endstring - 2, "ox")
+ && baselen > 5 && strcmpi(endstring - 6, "muskox")) {
/* "fox" -> "foxes" */
Strcasecpy(endstring, "es");
return TRUE;
}
if (to_plural) {
- if (!strcmpi(endstring - 3, "man")
+ if (baselen > 2 && !strcmpi(endstring - 3, "man")
&& badman(basestr, to_plural)) {
Strcasecpy(endstring, "s");
return TRUE;
}
} else {
- if (!strcmpi(endstring - 3, "men")
+ if (baselen > 2 && !strcmpi(endstring - 3, "men")
&& badman(basestr, to_plural))
return TRUE;
}