From 6be99f941dcaaf477961ca740ebeae66046d2341 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Mon, 30 Aug 2021 10:25:21 +0200 Subject: [PATCH] Escaping of backslash --- src/slic3r/GUI/DesktopIntegrationDialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/DesktopIntegrationDialog.cpp b/src/slic3r/GUI/DesktopIntegrationDialog.cpp index d34d0730e..935121935 100644 --- a/src/slic3r/GUI/DesktopIntegrationDialog.cpp +++ b/src/slic3r/GUI/DesktopIntegrationDialog.cpp @@ -28,7 +28,7 @@ namespace { std::string escape_string(const std::string& str) { // The buffer needs to be bigger if escaping <,>,& - std::vector out(str.size() * 2, 0); + std::vector 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 /*