Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly incorrect registry variant parsing #587

Closed
mahkoh opened this issue Jan 10, 2025 · 4 comments · Fixed by #588
Closed

Possibly incorrect registry variant parsing #587

mahkoh opened this issue Jan 10, 2025 · 4 comments · Fixed by #588
Labels
bug Indicates an unexpected problem or unintended behavior registry Indicates a need for improvements or additions to Registry

Comments

@mahkoh
Copy link

mahkoh commented Jan 10, 2025

While implementing registry parsing in my implementation, I saw this sus code:

if (streq(v->name, config.name) && streq(v->name, l->name)) {

Comparing v->name and config->name looks incorrect given that

v->variant = steal(&config.name);

@wismill
Copy link
Member

wismill commented Jan 10, 2025

It’s not the same v, see:

v = rxkb_layout_create(&ctx->base);
.

@mahkoh
Copy link
Author

mahkoh commented Jan 10, 2025

But surely in the if, the v is the same both left and right of the &&.

@wismill
Copy link
Member

wismill commented Jan 10, 2025

Shouldn’t we have:

- if (streq(v->name, config.name) && streq(v->name, l->name)) {
+ if (streq(v->variant, config.name) && streq(v->name, l->name)) {

?

@wismill wismill added registry Indicates a need for improvements or additions to Registry needs info labels Jan 10, 2025
@mahkoh
Copy link
Author

mahkoh commented Jan 10, 2025

That is my thinking as well except that v->variant might be null iirc.

@wismill wismill added bug Indicates an unexpected problem or unintended behavior and removed needs info labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior registry Indicates a need for improvements or additions to Registry
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants