diff options
author | 2018-11-10 12:55:06 +0000 | |
---|---|---|
committer | 2018-11-10 12:55:06 +0000 | |
commit | b865dabebab717fea75f91e8ccebabc99e36bdd9 (patch) | |
tree | df51bf83b899933f1347508b9f1bd55aefa21ae5 /sway/commands/seat/fallback.c | |
parent | Merge pull request #3085 from 7415963987456321/master (diff) | |
download | sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.gz sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.zst sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.zip |
Use parse_boolean where possible.
Diffstat (limited to 'sway/commands/seat/fallback.c')
-rw-r--r-- | sway/commands/seat/fallback.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sway/commands/seat/fallback.c b/sway/commands/seat/fallback.c index 11f5a08c..a0ddf3ef 100644 --- a/sway/commands/seat/fallback.c +++ b/sway/commands/seat/fallback.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "sway/config.h" | 3 | #include "sway/config.h" |
4 | #include "sway/commands.h" | 4 | #include "sway/commands.h" |
5 | #include "sway/input/input-manager.h" | 5 | #include "sway/input/input-manager.h" |
6 | #include "util.h" | ||
6 | 7 | ||
7 | struct cmd_results *seat_cmd_fallback(int argc, char **argv) { | 8 | struct cmd_results *seat_cmd_fallback(int argc, char **argv) { |
8 | struct cmd_results *error = NULL; | 9 | struct cmd_results *error = NULL; |
@@ -16,16 +17,8 @@ struct cmd_results *seat_cmd_fallback(int argc, char **argv) { | |||
16 | } | 17 | } |
17 | struct seat_config *new_config = | 18 | struct seat_config *new_config = |
18 | new_seat_config(current_seat_config->name); | 19 | new_seat_config(current_seat_config->name); |
19 | 20 | ||
20 | if (strcasecmp(argv[0], "true") == 0) { | 21 | new_config->fallback = parse_boolean(argv[0], false); |
21 | new_config->fallback = 1; | ||
22 | } else if (strcasecmp(argv[0], "false") == 0) { | ||
23 | new_config->fallback = 0; | ||
24 | } else { | ||
25 | free_seat_config(new_config); | ||
26 | return cmd_results_new(CMD_INVALID, "fallback", | ||
27 | "Expected 'fallback <true|false>'"); | ||
28 | } | ||
29 | 22 | ||
30 | if (!config->validating) { | 23 | if (!config->validating) { |
31 | apply_seat_config(new_config); | 24 | apply_seat_config(new_config); |