aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-01-18 08:23:48 -0500
committerGitHub <noreply@github.com>2019-01-18 08:23:48 -0500
commitdd4a6586b24b67df522d1617a6fac774cefd9821 (patch)
treed30b5ea1b5b78fcb1fed26175a1a9e9a29b80870 /sway/commands
parent978d6cd854c6340690387d07e159675b6406565d (diff)
parentd80386150404f4d08268ce17af5f3e9c53e56200 (diff)
Merge pull request #3457 from emersion/swaybg-no-escape
Don't escape swaybg arguments anymore
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/output/background.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index ae2f0640..00038e67 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -34,8 +34,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
struct output_config *output = config->handler_context.output_config;
if (strcasecmp(argv[1], "solid_color") == 0) {
- output->background = calloc(1, strlen(argv[0]) + 3);
- snprintf(output->background, strlen(argv[0]) + 3, "\"%s\"", argv[0]);
+ output->background = strdup(argv[0]);
output->background_option = strdup("solid_color");
output->background_fallback = NULL;
argc -= 2; argv += 2;
@@ -119,16 +118,6 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
src);
free(src);
} else {
- // Escape double quotes in the final path for swaybg
- for (size_t i = 0; i < strlen(src); i++) {
- if (src[i] == '"') {
- src = realloc(src, strlen(src) + 2);
- memmove(src + i + 1, src + i, strlen(src + i) + 1);
- *(src + i) = '\\';
- i++;
- }
- }
-
output->background = src;
output->background_option = strdup(mode);
}
@@ -136,9 +125,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
output->background_fallback = NULL;
if (argc && *argv[0] == '#') {
- output->background_fallback = calloc(1, strlen(argv[0]) + 3);
- snprintf(output->background_fallback, strlen(argv[0]) + 3,
- "\"%s\"", argv[0]);
+ output->background_fallback = strdup(argv[0]);
argc--; argv++;
if (!can_access) {
@@ -153,4 +140,3 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
config->handler_context.leftovers.argv = argv;
return NULL;
}
-