From ee85342c25f910e5abf3002da7d13f2e7ceb5181 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 3 Sep 2004 11:20:51 +0000 Subject: [PATCH] Don't error out when 'PATH', 'Path', or 'path' has empty elements. [SVN r24889] --- src/tools/common.jam | 2 +- src/util/path.jam | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/tools/common.jam b/src/tools/common.jam index 5614d3629..f50087867 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -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 ] ; diff --git a/src/util/path.jam b/src/util/path.jam index eae1a64da..d4bfa39d0 100644 --- a/src/util/path.jam +++ b/src/util/path.jam @@ -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 ) {