summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-03-06 02:14:24 (GMT)
committerSteven Knight <knight@baldmt.com>2009-03-06 02:14:24 (GMT)
commit47a5f6f17fa7f72065bd42dec4d645e5c1325aef (patch)
treefd72838bc3195ba2cc25205623db6bd523dcabef
parentd6d135367931bcab667ce5d636e905d9712d6370 (diff)
downloadSCons-47a5f6f17fa7f72065bd42dec4d645e5c1325aef.zip
SCons-47a5f6f17fa7f72065bd42dec4d645e5c1325aef.tar.gz
SCons-47a5f6f17fa7f72065bd42dec4d645e5c1325aef.tar.bz2
Issue 2368: Fix an exception when a null command-line argument is
passed in.
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Script/Main.py2
-rw-r--r--test/no-arguments.py17
3 files changed, 17 insertions, 4 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 49dfcfa..a902e4c 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -19,6 +19,8 @@ RELEASE X.X.X - XXX
- Fix a TypeError on #include of file names with Unicode characters.
+ - Fix an exception if a null command-line argument is passed in.
+
RELEASE 1.2.0.d20090223 - Mon, 23 Feb 2009 08:41:06 -0800
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 883af40..c70708d 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -868,7 +868,7 @@ def _main(parser):
targets = []
xmit_args = []
for a in parser.largs:
- if a[0] == '-':
+ if a[:1] == '-':
continue
if '=' in a:
xmit_args.append(a)
diff --git a/test/no-arguments.py b/test/no-arguments.py
index 46c06fb..0fa0d8a 100644
--- a/test/no-arguments.py
+++ b/test/no-arguments.py
@@ -26,8 +26,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Verify that we use a default target of the current directory when there
-are no command-line arguments (and, implicitly, no Default() in the
-SConstruct).
+is no Default() in the SConstruct file and there are no command-line
+arguments, or a null command-line argument.
"""
import os.path
@@ -52,10 +52,21 @@ env.Build('aaa.out', 'aaa.in')
test.write('aaa.in', "aaa.in\n")
+up_to_date = test.wrap_stdout("scons: `.' is up to date.\n")
+
#
test.run()
+test.must_match('aaa.out', "aaa.in\n")
+test.run(stdout=up_to_date)
+
+#
+test.unlink('aaa.out')
+test.must_not_exist('aaa.out')
-test.fail_test(test.read('aaa.out') != "aaa.in\n")
+#
+test.run([''])
+test.must_match('aaa.out', "aaa.in\n")
+test.run([''], stdout=up_to_date)
#
test.pass_test()