summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Action.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-01-29 16:37:02 (GMT)
committerSteven Knight <knight@baldmt.com>2002-01-29 16:37:02 (GMT)
commitfc1f577e9fc77c19844b694ab4952ddbb3747bcd (patch)
tree7229fa56698c7d00b22e72842fadade65f9ab48d /src/engine/SCons/Action.py
parent2479d0f7efbfceb6a43eec7411a35ba13f58fc90 (diff)
downloadSCons-fc1f577e9fc77c19844b694ab4952ddbb3747bcd.zip
SCons-fc1f577e9fc77c19844b694ab4952ddbb3747bcd.tar.gz
SCons-fc1f577e9fc77c19844b694ab4952ddbb3747bcd.tar.bz2
Put quotes around arguments that contain white space, for appearance and for Windows NT portabilitiy.
Diffstat (limited to 'src/engine/SCons/Action.py')
-rw-r--r--src/engine/SCons/Action.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index 22c38fa..19ec05c 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -140,8 +140,13 @@ elif os.name == 'nt':
return 127
else:
try:
- args = [ cmd_interp, '/C' ] + args
- ret = os.spawnve(os.P_WAIT, cmd_interp, args, env)
+
+ a = [ cmd_interp, '/C', args[0] ]
+ for arg in args[1:]:
+ if ' ' in arg or '\t' in arg:
+ arg = '"' + arg + '"'
+ a.append(arg)
+ ret = os.spawnve(os.P_WAIT, cmd_interp, a, env)
except OSError, e:
ret = exitvalmap[e[0]]
sys.stderr.write("scons: %s: %s\n" % (cmd, e[1]))
@@ -254,7 +259,12 @@ class CommandAction(ActionBase):
for cmd_line in cmd_list:
if len(cmd_line):
if print_actions:
- self.show(string.join(cmd_line))
+ cl = []
+ for arg in cmd_line:
+ if ' ' in arg or '\t' in arg:
+ arg = '"' + arg + '"'
+ cl.append(arg)
+ self.show(string.join(cl))
if execute_actions:
try:
ENV = kw['env']['ENV']