Check for exact match for layout name before looking for a prefix match.

This commit is contained in:
nicm 2024-08-23 10:19:06 +00:00
parent 4860a58d07
commit 6e9a914014

View File

@ -55,6 +55,10 @@ layout_set_lookup(const char *name)
u_int i; u_int i;
int matched = -1; int matched = -1;
for (i = 0; i < nitems(layout_sets); i++) {
if (strcmp(layout_sets[i].name, name) == 0)
return (i);
}
for (i = 0; i < nitems(layout_sets); i++) { for (i = 0; i < nitems(layout_sets); i++) {
if (strncmp(layout_sets[i].name, name, strlen(name)) == 0) { if (strncmp(layout_sets[i].name, name, strlen(name)) == 0) {
if (matched != -1) /* ambiguous */ if (matched != -1) /* ambiguous */