From 00fd626757fe107e12827dbc7a79da487ed98faf Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 14 Sep 2020 19:42:44 -0500 Subject: [PATCH] Fix patty_conf_read() backslash escape bug Fix patty_conf_read() bug wherein backslash escapes simply did not work as intended --- src/conf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf.c b/src/conf.c index 2f7850c..d754351 100644 --- a/src/conf.c +++ b/src/conf.c @@ -209,6 +209,8 @@ int patty_conf_read(const char *path, lineno = 1, column = 0; + uint8_t last = '\0'; + if (file_read(&file, path) < 0) { goto error_file_read; } @@ -321,9 +323,11 @@ int patty_conf_read(const char *path, } } - if (escape == ESCAPE_ON) { + if (escape == ESCAPE_ON && last == '\\') { escape = ESCAPE_OFF; } + + last = c; } if (token.len) {