commit ef387c81af1294a3b5e7f65c23b313c371224b33
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Jan 27 09:15:47 2017 +0100
Handle backslash in escape function.
Fixes: #4595.
Candidate for stable
---
src/support/lstrings.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp
index 99591d0..1e3d346 100644
--- a/src/support/lstrings.cpp
+++ b/src/support/lstrings.cpp
@@ -1180,7 +1180,8 @@ docstring const escape(docstring const & lab)
for (size_t i = 0; i < lab.length(); ++i) {
char_type c = lab[i];
if (c >= 128 || c == '=' || c == '%' || c == '#' || c == '$'
- || c == '}' || c == '{' || c == ']' || c == '[' || c ==
'&') {
+ || c == '}' || c == '{' || c == ']' || c == '[' || c == '&'
+ || c == '\\') {
// Although char_type is a 32 bit type we know that
// UCS4 occupies only 21 bits, so we don't need to
// encode bigger values. Test for 2^24 because we