diff mbox

[2/2] rules.mak: Fix find-in-path

Message ID 1352898739-57797-3-git-send-email-cornelia.huck@de.ibm.com
State New
Headers show

Commit Message

Cornelia Huck Nov. 14, 2012, 1:12 p.m. UTC
Whitespace needs to be stripped before building the path and in
the end to ensure we really get an empty string.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 rules.mak | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/rules.mak b/rules.mak
index 1b173aa..66b1d79 100644
--- a/rules.mak
+++ b/rules.mak
@@ -55,9 +55,9 @@  set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN)
 # Looks in the PATH if the argument contains no slash, else only considers one
 # specific directory.  Returns an # empty string if the program doesn't exist
 # there.
-find-in-path = $(if $(find-string /, $1), \
+find-in-path = $(strip $(if $(find-string /, $1), \
         $(wildcard $1), \
-        $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH)))))
+        $(wildcard $(patsubst %, %/$(strip $1), $(subst :, ,$(PATH))))))
 
 # Generate files with tracetool
 TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py