From da76ecb5f8bb0e0d9aeb31e39391ca5d361fa619 Mon Sep 17 00:00:00 2001 From: taiyu Date: Tue, 8 Sep 2015 09:10:36 -0700 Subject: [PATCH] escape check fix --- sway/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sway/config.c b/sway/config.c index daaedeed5..4636cff65 100644 --- a/sway/config.c +++ b/sway/config.c @@ -278,8 +278,9 @@ char *do_var_replacement(char *str) { char *find = str; while ((find = strchr(find, '$'))) { // Skip if escaped. - if (find > str + 1 && find[-1] == '\\') { - if (!(find > str + 2 && find[-2] == '\\')) { + if (find > str && find[-1] == '\\') { + if (find == str + 1 || !(find > str + 1 && find[-2] == '\\')) { + ++find; continue; } }