diff options
-rw-r--r-- | src/Ninja.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Ninja.cpp b/src/Ninja.cpp index 778e701..70b0b57 100644 --- a/src/Ninja.cpp +++ b/src/Ninja.cpp @@ -78,12 +78,18 @@ namespace ninja result.reserve(str.size()); for(char c : str) { - if(c == '"') - result += "\\\""; + if(c == '\n') + result += "$\n"; + else if(c == '$') + result += "$$"; + else if(c == ' ') + result += "$ "; + else if(c == ':') + result += "$:"; else result += c; } - return '"' + result + '"'; + return result; } static std::string combine_escape(const std::vector<std::string> &strs) |