Escaping of backslash
This commit is contained in:
parent
14659cf760
commit
6be99f941d
@ -28,7 +28,7 @@ namespace {
|
||||
std::string escape_string(const std::string& str)
|
||||
{
|
||||
// The buffer needs to be bigger if escaping <,>,&
|
||||
std::vector<char> out(str.size() * 2, 0);
|
||||
std::vector<char> out(str.size() * 4, 0);
|
||||
char *outptr = out.data();
|
||||
for (size_t i = 0; i < str.size(); ++ i) {
|
||||
char c = str[i];
|
||||
@ -45,6 +45,8 @@ std::string escape_string(const std::string& str)
|
||||
} else if (c == '\\') { // backslash character
|
||||
(*outptr ++) = '\\';
|
||||
(*outptr ++) = '\\';
|
||||
(*outptr ++) = '\\';
|
||||
(*outptr ++) = '\\';
|
||||
// Reserved characters
|
||||
// At Ubuntu, all these characters must NOT be escaped for desktop integration to work
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user