mirror of
https://github.com/swaywm/sway.git
synced 2025-01-22 00:36:40 +00:00
Fix has_prefix() comparisons with 0
has_prefix() returns a bool, unlike strncmp() which returns an int.
Fixes: 0c60d1581f
("Use has_prefix() instead of strncmp() throughout")
Closes: https://github.com/swaywm/sway/issues/8527
This commit is contained in:
parent
0c60d1581f
commit
a1838c5522
|
@ -398,7 +398,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
|
||||||
list_t *split = split_string(argv[0], "+");
|
list_t *split = split_string(argv[0], "+");
|
||||||
for (int i = 0; i < split->length; ++i) {
|
for (int i = 0; i < split->length; ++i) {
|
||||||
// Check for group
|
// Check for group
|
||||||
if (has_prefix(split->items[i], "Group") == 0) {
|
if (has_prefix(split->items[i], "Group")) {
|
||||||
if (binding->group != XKB_LAYOUT_INVALID) {
|
if (binding->group != XKB_LAYOUT_INVALID) {
|
||||||
free_sway_binding(binding);
|
free_sway_binding(binding);
|
||||||
list_free_items_and_destroy(split);
|
list_free_items_and_destroy(split);
|
||||||
|
|
|
@ -23,7 +23,7 @@ struct cmd_results *cmd_mark(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool add = false, toggle = false;
|
bool add = false, toggle = false;
|
||||||
while (argc > 0 && has_prefix(*argv, "--") == 0) {
|
while (argc > 0 && has_prefix(*argv, "--")) {
|
||||||
if (strcmp(*argv, "--add") == 0) {
|
if (strcmp(*argv, "--add") == 0) {
|
||||||
add = true;
|
add = true;
|
||||||
} else if (strcmp(*argv, "--replace") == 0) {
|
} else if (strcmp(*argv, "--replace") == 0) {
|
||||||
|
|
Loading…
Reference in a new issue