From 67da9e6b45cb467647ceda5f1998ee7b0330801e Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 18 Feb 2017 22:31:29 +0100 Subject: [PATCH] Do not expand the doubly-escaped sequences. Closes #520. --- src/core/misc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/misc.c b/src/core/misc.c index 1cfa15b6..6be62393 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -719,6 +719,13 @@ int expand_escape(const char **data) } } return strtol(digit, NULL, 8); + + case '\\': + /* escaped sequence, if the next character isn't part of a valid + * sequence then we don't skip the leading slash. */ + if (strchr("trnexc01234567", (*data)[1]) != NULL) + *data += 1; + return -1; default: return -1; }