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:
parent
cb33d799ff
commit
00fd626757
1 changed files with 5 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue