Fix patty_conf_read() backslash escape bug

Fix patty_conf_read() bug wherein backslash escapes simply did not
work as intended
This commit is contained in:
XANTRONIX Development 2020-09-14 19:42:44 -05:00 committed by XANTRONIX Industrial
parent cb33d799ff
commit 00fd626757

View file

@ -209,6 +209,8 @@ int patty_conf_read(const char *path,
lineno = 1, lineno = 1,
column = 0; column = 0;
uint8_t last = '\0';
if (file_read(&file, path) < 0) { if (file_read(&file, path) < 0) {
goto error_file_read; 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; escape = ESCAPE_OFF;
} }
last = c;
} }
if (token.len) { if (token.len) {