aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-06-07 20:37:08 -0400
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-06-07 20:37:08 -0400
commit212e4ef39518c4bb29eeef46f705770d3d28a6fc (patch)
tree19c1eb89136d7c96aa7a61703e362fba2fd1fa1d
parentMerge pull request #2084 from RedSoxFan/runtime-var-expansion (diff)
downloadsway-212e4ef39518c4bb29eeef46f705770d3d28a6fc.tar.gz
sway-212e4ef39518c4bb29eeef46f705770d3d28a6fc.tar.zst
sway-212e4ef39518c4bb29eeef46f705770d3d28a6fc.zip
Remove strip quoting and fix strncpy-overlap
-rw-r--r--sway/commands.c1
-rw-r--r--sway/config.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 464c9932..1523fdd1 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -274,7 +274,6 @@ struct cmd_results *execute_command(char *_exec, struct sway_seat *seat) {
274 for (int i = handler->handle == cmd_set ? 2 : 1; i < argc; ++i) { 274 for (int i = handler->handle == cmd_set ? 2 : 1; i < argc; ++i) {
275 argv[i] = do_var_replacement(argv[i]); 275 argv[i] = do_var_replacement(argv[i]);
276 unescape_string(argv[i]); 276 unescape_string(argv[i]);
277 strip_quotes(argv[i]);
278 } 277 }
279 278
280 if (!config->handler_context.using_criteria) { 279 if (!config->handler_context.using_criteria) {
diff --git a/sway/config.c b/sway/config.c
index 0e41df04..949c5cd3 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -660,7 +660,7 @@ char *do_var_replacement(char *str) {
660 // Unescape double $ and move on 660 // Unescape double $ and move on
661 if (find[1] == '$') { 661 if (find[1] == '$') {
662 size_t length = strlen(find + 1); 662 size_t length = strlen(find + 1);
663 strncpy(find, find + 1, length); 663 memmove(find, find + 1, length);
664 find[length] = '\0'; 664 find[length] = '\0';
665 ++find; 665 ++find;
666 continue; 666 continue;