Index: build/gyp_chromium |
diff --git a/build/gyp_chromium b/build/gyp_chromium |
index d05204b77f2b769af4a1436a45870dcb6fbb5ba9..8713b43400a098c3d90fe3dad72fc75883ce5076 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 [('\\', '\\\\'), ('$', '\\$'), ('"', '\\"')]: |
+ s = s.replace(old, new) |
+ return '"' + s + '"' |
def ProcessGypDefinesItems(items): |