summaryrefslogtreecommitdiffstats
path: root/build/gyp_chromium
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-02 16:17:12 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-02 16:17:12 +0000
commit5bf744d0b049414ae5e6521c1f43055b93af4ca0 (patch)
tree6f3d30b87770916d90f253ff9258cf842dfa9197 /build/gyp_chromium
parent63c827810502bb8b4448446929ddd45cb3f1ded6 (diff)
downloadchromium_src-5bf744d0b049414ae5e6521c1f43055b93af4ca0.zip
chromium_src-5bf744d0b049414ae5e6521c1f43055b93af4ca0.tar.gz
chromium_src-5bf744d0b049414ae5e6521c1f43055b93af4ca0.tar.bz2
gn/gyp: Escape \ in addition to $ and " in strings.
BUG=340055 R=halyavin@google.com TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/144573004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/gyp_chromium')
-rwxr-xr-xbuild/gyp_chromium5
1 files changed, 3 insertions, 2 deletions
diff --git a/build/gyp_chromium b/build/gyp_chromium
index d05204b..8713b43 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):