From ca2043d9f20018ebcae363dce9eedc8aff4eeb99 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 20 Sep 2015 11:47:20 +0100 Subject: [PATCH] Fix unescape implementation --- src/string.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/string.cc b/src/string.cc index 45264898..357b4f2f 100644 --- a/src/string.cc +++ b/src/string.cc @@ -91,10 +91,13 @@ String unescape(StringView str, StringView characters, char escape) { res += StringView{it, next+1}; res.back() = *(next+1); + it = next + 2; } else + { res += StringView{it, next == end ? next : next + 1}; - it = next == end ? next : next + 1; + it = next == end ? next : next + 1; + } } return res; }