Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: tools/gn/escape.cc

Issue 26561005: GYP generator for GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/escape.h ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/escape.cc
diff --git a/tools/gn/escape.cc b/tools/gn/escape.cc
index f00bb63de2b59f310f3eab7f4d467c414371cb3b..e10e24a2b68c48f6a5c0454e33ecd036879320e0 100644
--- a/tools/gn/escape.cc
+++ b/tools/gn/escape.cc
@@ -42,6 +42,9 @@ void EscapeStringToString(const base::StringPiece& str,
}
}
dest->push_back(' ');
+ } else if (str[i] == '\'' && (options.mode & ESCAPE_JSON)) {
+ dest->push_back('\\');
+ dest->push_back('\'');
#if defined(OS_WIN)
} else if (str[i] == '/' && options.convert_slashes) {
// Convert slashes on Windows if requested.
@@ -52,6 +55,9 @@ void EscapeStringToString(const base::StringPiece& str,
dest->push_back('\\');
dest->push_back('\\');
#endif
+ } else if (str[i] == '\\' && (options.mode & ESCAPE_JSON)) {
+ dest->push_back('\\');
+ dest->push_back('\\');
} else {
dest->push_back(str[i]);
}
« no previous file with comments | « tools/gn/escape.h ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698