Issue 2368: Fix an exception when a null command-line argument is
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 6 Mar 2009 02:14:24 +0000 (02:14 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 6 Mar 2009 02:14:24 +0000 (02:14 +0000)
passed in.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@4066 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Script/Main.py
test/no-arguments.py

index 49dfcfa6f73b0be9f178b01f3d30bd1822bc16d5..a902e4ce4acf51c9027a9d951c42470041890883 100644 (file)
@@ -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
index 883af409c1e3b19979273035c1bb90039e13fcb6..c70708d97cf15bf1c0eb686ad4ef5ea4d069b88f 100644 (file)
@@ -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)
index 46c06fbd239c179229b1f366dca2884d8d02bde7..0fa0d8a6e01765c1af24f752f5b84155209b3529 100644 (file)
@@ -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()