Don't error out when 'PATH', 'Path', or 'path' has empty elements.

[SVN r24889]
This commit is contained in:
Vladimir Prus 2004-09-03 11:20:51 +00:00
parent e7c04a87b7
commit 21277abf83
2 changed files with 16 additions and 2 deletions

View File

@ -166,7 +166,7 @@ rule get-absolute-tool-path ( command )
# If 'path-last' is specified, path is checked after 'additional-paths'.
rule find-tool ( name : additional-paths * : path-last ? )
{
local path = [ sequence.transform path.make : [ modules.peek : PATH Path path ] ] ;
local path = [ path.programs-path ] ;
local match = [ path.glob $(path) : $(name) $(name).exe ] ;
local additional-match = [ path.glob $(additional-paths) : $(name) $(name).exe ] ;

View File

@ -320,7 +320,21 @@ rule relative-to ( path1 path2 )
return [ join . $(root_1) $(split2) ] ;
}
# Returns the list of paths which are used by the operating system
# for looking up programs
rule programs-path ( )
{
local result ;
local raw = [ modules.peek : PATH Path path ] ;
for local p in $(raw)
{
if $(p)
{
result += [ path.make $(p) ] ;
}
}
return $(result) ;
}
rule make-NT ( native )
{