diff options
Diffstat (limited to 'sway/commands/output/background.c')
-rw-r--r-- | sway/commands/output/background.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c index 2cd1b76a..ae2f0640 100644 --- a/sway/commands/output/background.c +++ b/sway/commands/output/background.c | |||
@@ -20,14 +20,14 @@ static const char *bg_options[] = { | |||
20 | 20 | ||
21 | struct cmd_results *output_cmd_background(int argc, char **argv) { | 21 | struct cmd_results *output_cmd_background(int argc, char **argv) { |
22 | if (!config->handler_context.output_config) { | 22 | if (!config->handler_context.output_config) { |
23 | return cmd_results_new(CMD_FAILURE, "output", "Missing output config"); | 23 | return cmd_results_new(CMD_FAILURE, "Missing output config"); |
24 | } | 24 | } |
25 | if (!argc) { | 25 | if (!argc) { |
26 | return cmd_results_new(CMD_INVALID, "output", | 26 | return cmd_results_new(CMD_INVALID, |
27 | "Missing background file or color specification."); | 27 | "Missing background file or color specification."); |
28 | } | 28 | } |
29 | if (argc < 2) { | 29 | if (argc < 2) { |
30 | return cmd_results_new(CMD_INVALID, "output", | 30 | return cmd_results_new(CMD_INVALID, |
31 | "Missing background scaling mode or `solid_color`."); | 31 | "Missing background scaling mode or `solid_color`."); |
32 | } | 32 | } |
33 | 33 | ||
@@ -57,7 +57,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | if (!valid) { | 59 | if (!valid) { |
60 | return cmd_results_new(CMD_INVALID, "output", | 60 | return cmd_results_new(CMD_INVALID, |
61 | "Missing background scaling mode."); | 61 | "Missing background scaling mode."); |
62 | } | 62 | } |
63 | 63 | ||
@@ -70,7 +70,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
70 | *ptr = '\\'; | 70 | *ptr = '\\'; |
71 | } | 71 | } |
72 | if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) { | 72 | if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) { |
73 | struct cmd_results *cmd_res = cmd_results_new(CMD_INVALID, "output", | 73 | struct cmd_results *cmd_res = cmd_results_new(CMD_INVALID, |
74 | "Invalid syntax (%s)", src); | 74 | "Invalid syntax (%s)", src); |
75 | free(src); | 75 | free(src); |
76 | wordfree(&p); | 76 | wordfree(&p); |
@@ -81,8 +81,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
81 | wordfree(&p); | 81 | wordfree(&p); |
82 | if (!src) { | 82 | if (!src) { |
83 | wlr_log(WLR_ERROR, "Failed to duplicate string"); | 83 | wlr_log(WLR_ERROR, "Failed to duplicate string"); |
84 | return cmd_results_new(CMD_FAILURE, "output", | 84 | return cmd_results_new(CMD_FAILURE, "Unable to allocate resource"); |
85 | "Unable to allocate resource"); | ||
86 | } | 85 | } |
87 | 86 | ||
88 | if (config->reading && *src != '/') { | 87 | if (config->reading && *src != '/') { |
@@ -92,7 +91,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
92 | if (!conf) { | 91 | if (!conf) { |
93 | wlr_log(WLR_ERROR, "Failed to duplicate string"); | 92 | wlr_log(WLR_ERROR, "Failed to duplicate string"); |
94 | free(src); | 93 | free(src); |
95 | return cmd_results_new(CMD_FAILURE, "output", | 94 | return cmd_results_new(CMD_FAILURE, |
96 | "Unable to allocate resources"); | 95 | "Unable to allocate resources"); |
97 | } | 96 | } |
98 | 97 | ||
@@ -103,7 +102,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) { | |||
103 | free(rel_path); | 102 | free(rel_path); |
104 | free(conf); | 103 | free(conf); |
105 | wlr_log(WLR_ERROR, "Unable to allocate memory"); | 104 | wlr_log(WLR_ERROR, "Unable to allocate memory"); |
106 | return cmd_results_new(CMD_FAILURE, "output", | 105 | return cmd_results_new(CMD_FAILURE, |
107 | "Unable to allocate resources"); | 106 | "Unable to allocate resources"); |
108 | } | 107 | } |
109 | 108 | ||