diff options
author | Mats Wichmann <mats@linux.com> | 2021-03-25 09:12:35 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2021-03-25 09:12:35 (GMT) |
commit | c00b8401e4003a611a261c91eb07ef091acb692a (patch) | |
tree | d1f31d27d7cff7e1ff62f28e5fd49cecea4240bb /SCons/Script | |
parent | a25f3ec81a3382b833393aff27b0d9eca1f70b1f (diff) | |
download | SCons-c00b8401e4003a611a261c91eb07ef091acb692a.zip SCons-c00b8401e4003a611a261c91eb07ef091acb692a.tar.gz SCons-c00b8401e4003a611a261c91eb07ef091acb692a.tar.bz2 |
Skip empty cmdline args as targets
Previously, quoted empty arguments like '', '""', "''" were
added to targets, which had some side effects - a blank would
eventually turn into a Node for the top directory, meaning
Default calls were ignored since a target is specified and
thus the whole tree will be built.
Fixes #2986
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Script')
-rw-r--r-- | SCons/Script/Main.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py index c1bb016..80124be 100644 --- a/SCons/Script/Main.py +++ b/SCons/Script/Main.py @@ -984,13 +984,17 @@ def _main(parser): if options.interactive: SCons.Node.interactive = True - # That should cover (most of) the options. Next, set up the variables - # that hold command-line arguments, so the SConscript files that we - # read and execute have access to them. + # That should cover (most of) the options. + # Next, set up the variables that hold command-line arguments, + # so the SConscript files that we read and execute have access to them. + # TODO: for options defined via AddOption which take space-separated + # option-args, the option-args will collect into targets here, + # because we don't yet know to do any different. targets = [] xmit_args = [] for a in parser.largs: - if a[:1] == '-': + # Skip so-far unrecognized options, and empty string args + if a.startswith('-') or a in ('', '""', "''"): continue if '=' in a: xmit_args.append(a) |