summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-02-04 07:43:14 (GMT)
committerSteven Knight <knight@baldmt.com>2004-02-04 07:43:14 (GMT)
commitee76a275db34fd524f5c85588c2cdffa6022778e (patch)
tree0bb9b6fb36ae0d4231e7e1bef64e2d1d5a2766dc /src/engine
parent2ae8d5022b9593ea1992f350a57010397c269c29 (diff)
downloadSCons-ee76a275db34fd524f5c85588c2cdffa6022778e.zip
SCons-ee76a275db34fd524f5c85588c2cdffa6022778e.tar.gz
SCons-ee76a275db34fd524f5c85588c2cdffa6022778e.tar.bz2
Fix a new variable expansion bug.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Util.py9
-rw-r--r--src/engine/SCons/UtilTests.py6
2 files changed, 13 insertions, 2 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 6d95a4e..594274a 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -718,7 +718,9 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, di
env=self.env,
for_signature=(self.mode != SUBST_CMD))
self.substitute(s, lvars, within_list)
- elif not s is None:
+ elif s is None:
+ self.this_word()
+ else:
self.append(s)
def substitute(self, args, lvars, within_list):
@@ -758,7 +760,10 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, di
def add_to_current_word(self, x):
if not self.in_strip or self.mode != SUBST_SIG:
- self[-1][-1] = self[-1][-1] + x
+ try:
+ self[-1][-1] = self[-1][-1] + x
+ except IndexError:
+ self.add_new_word(x)
def add_new_word(self, x):
if not self.in_strip or self.mode != SUBST_SIG:
try:
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index fb4ec09..6468949 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -296,6 +296,9 @@ class UtilTestCase(unittest.TestCase):
# Test function calls within ${}.
'$FUNCCALL', 'a xc b',
+
+ # Bug reported by Christoph Wiedemann.
+ '$xxx/bin', '/bin',
]
kwargs = {'target' : target, 'source' : source}
@@ -609,6 +612,9 @@ class UtilTestCase(unittest.TestCase):
'foo\n\nbar', [['foo'], ['bar']],
'foo \n \n bar', [['foo'], ['bar']],
'foo \nmiddle\n bar', [['foo'], ['middle'], ['bar']],
+
+ # Bug reported by Christoph Wiedemann.
+ '$xxx/bin', [['/bin']],
]
kwargs = {'target' : target, 'source' : source}