fix(hwgen): prevent prefix collisions when resolving source names (#7533)

This commit is contained in:
norulers
2026-07-10 13:40:01 +10:00
committed by GitHub
parent 7f228ffec1
commit df1f8270bb
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -308,7 +308,7 @@ int switchLookupIdx(const char* name, size_t len)
auto max_switches = switchGetMaxAllSwitches();
for (int i = 0; i < max_switches; i++) {
const char *sw_name = switchGetDefaultName(i);
if (strncmp(sw_name, name, len) == 0) return i;
if (strlen(sw_name) == len && strncmp(sw_name, name, len) == 0) return i;
}
return -1;