Index: build/gyp_chromium |
diff --git a/build/gyp_chromium b/build/gyp_chromium |
index d05204b77f2b769af4a1436a45870dcb6fbb5ba9..86b6a1731735a6d49b3fdb6718b8902c98087f30 100755 |
--- a/build/gyp_chromium |
+++ b/build/gyp_chromium |
@@ -77,8 +77,9 @@ def FormatKeyForGN(key): |
def EscapeStringForGN(s): |
"""Converts a string to a GN string literal.""" |
- # Escape $ characters which have special meaning to GN. |
- return '"' + s.replace('$', '\\$').replace('"', '\\"') + '"' |
+ for old, new in [('$', '\\$'), ('"', '\\"'), ('\\', '\\\\')]: |
halyavin
2014/02/02 03:38:22
\->\\ must be first, otherwise you will double esc
Nico
2014/02/02 03:42:48
Done. Thanks!
|
+ s = s.replace(old, new) |
+ return '"' + s + '"' |
def ProcessGypDefinesItems(items): |