aboutsummaryrefslogtreecommitdiff
path: root/buildconf
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-05-09 23:16:37 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-05-09 23:16:37 +0200
commita784ed60650478cedbee451e7c918bdca00a8d89 (patch)
treeec8cd0a7c8c88e29443ea57ad9eb7b0889007c0a /buildconf
parentd2621445f1947b32dff06dfa3356a9be966b96da (diff)
findtool: file name as a full path requires a slash
Kalle Vahlman's patch applied a while ago broke how the findtool function searches for tools, as it would always check if "$file" was present first, which thus made the bad assumption that a file in the current directory would be a match. I noticed when it found 'libtool' in the current directory but libtoolize is not there, which confused the script.
Diffstat (limited to 'buildconf')
-rwxr-xr-xbuildconf14
1 files changed, 10 insertions, 4 deletions
diff --git a/buildconf b/buildconf
index 89d94a8db..2b62afd50 100755
--- a/buildconf
+++ b/buildconf
@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -33,9 +33,15 @@ die(){
findtool(){
file="$1"
- if test -f "$file"; then
- echo "$file"
- return
+ if { echo $file | grep "/" >/dev/null 2>&1; } then
+ # we only check for the explicit file name if the file is given
+ # including a slash. Use ./ for current dir. Previously this would
+ # otherwise always cause findtool to search the local dir first, which
+ # is wrong.
+ if test -f "$file"; then
+ echo "$file"
+ return
+ fi
fi
old_IFS=$IFS; IFS=':'