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

Side by Side Diff: pylib/gyp/msvs_emulation.py

Issue 9395082: Quote arguments properly in rules for cmd on Windows ninja. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """ 5 """
6 This module helps emulate Visual Studio 2008 behavior on top of other 6 This module helps emulate Visual Studio 2008 behavior on top of other
7 build systems, primarily ninja. 7 build systems, primarily ninja.
8 """ 8 """
9 9
10 import re 10 import re
(...skipping 22 matching lines...) Expand all
33 # %'s also need to be doubled otherwise they're interpreted as batch 33 # %'s also need to be doubled otherwise they're interpreted as batch
34 # positional arguments. Also make sure to escape the % so that they're 34 # positional arguments. Also make sure to escape the % so that they're
35 # passed literally through escaping so they can be singled to just the 35 # passed literally through escaping so they can be singled to just the
36 # original %. Otherwise, trying to pass the literal representation that 36 # original %. Otherwise, trying to pass the literal representation that
37 # looks like an environment variable to the shell (e.g. %PATH%) would fail. 37 # looks like an environment variable to the shell (e.g. %PATH%) would fail.
38 tmp = tmp.replace('%', '^%^%') 38 tmp = tmp.replace('%', '^%^%')
39 39
40 # Finally, wrap the whole thing in quotes so that the above quote rule 40 # Finally, wrap the whole thing in quotes so that the above quote rule
41 # applies and whitespace isn't a word break. 41 # applies and whitespace isn't a word break.
42 return '"' + tmp + '"' 42 return '"' + tmp + '"'
43
44 def EncodeCmdExeArgList(args):
Nico 2012/02/21 05:56:14 The posix versions of these are called EncodePOSIX
scottmg 2012/02/21 06:08:20 Done.
45 """Process a list of arguments using QuoteCmdExeArgument."""
46 return ' '.join(QuoteCmdExeArgument(arg) for arg in args)
OLDNEW
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698