summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Util.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-02-09 23:42:29 (GMT)
committerSteven Knight <knight@baldmt.com>2002-02-09 23:42:29 (GMT)
commit09a60a303bd391e720848134ce3124b273d5162c (patch)
tree77f548ac4555f70a9a5be0b13f4afb7a85aebcd1 /src/engine/SCons/Util.py
parentaeefea2d7f66b819bbaf6dff8a8afef63b05722e (diff)
downloadSCons-09a60a303bd391e720848134ce3124b273d5162c.zip
SCons-09a60a303bd391e720848134ce3124b273d5162c.tar.gz
SCons-09a60a303bd391e720848134ce3124b273d5162c.tar.bz2
Fix variable interpolation with spaces, and problems with the WIN32 environment (Charles Crain).
Diffstat (limited to 'src/engine/SCons/Util.py')
-rw-r--r--src/engine/SCons/Util.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 2c921dc..fd95438 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -318,9 +318,23 @@ class VarInterpolator:
except KeyError:
suffix =''
- dict[self.dest] = map(lambda x, suff=suffix, pref=prefix: \
- pref + str(x) + suff,
- src)
+ def autogenFunc(x, suff=suffix, pref=prefix):
+ """Generate the interpolated variable. If the prefix
+ ends in a space, or the suffix begins in a space,
+ leave it as a separate element of the list."""
+ ret = [ str(x) ]
+ if pref and pref[-1] == ' ':
+ ret.insert(0, pref[:-1])
+ else:
+ ret[0] = pref + ret[0]
+ if suff and suff[0] == ' ':
+ ret.append(suff[1:])
+ else:
+ ret[-1] = ret[-1] + suff
+ return ret
+ dict[self.dest] = reduce(lambda x, y: x+y,
+ map(autogenFunc,
+ src))
def instance(self, dir, fs):
return self