aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-09-08 09:10:36 -0700
committertaiyu <taiyu.len@gmail.com>2015-09-08 09:10:36 -0700
commitda76ecb5f8bb0e0d9aeb31e39391ca5d361fa619 (patch)
treef5355b9fe8e5ad20933741cea0f6631250e5b893
parentd673a72705ea29afe58784b3ce169fb5bde73c11 (diff)
escape check fix
-rw-r--r--sway/config.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/config.c b/sway/config.c
index daaedeed..4636cff6 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;
}
}