]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(find_program): If argument contains a slash
authorNiels Möller <nisse@lysator.liu.se>
Fri, 25 Nov 2005 17:09:28 +0000 (18:09 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 25 Nov 2005 17:09:28 +0000 (18:09 +0100)
(most likely because VPATH expansion in make), return the filename
as is.

Rev: misc/run-tests:1.5

run-tests

index a15c744c656fcc4000f707807056d7df4a857f2d..f240599ff5d9eb24ffbb43f215841d80dce2e9d8 100755 (executable)
--- a/run-tests
+++ b/run-tests
@@ -12,12 +12,21 @@ fi
 
 export srcdir
 
+# When used in make rules, we sometimes get the filenames VPATH
+# expanded, but usually not. 
 find_program () {
-  if [ -x "$1" ] ; then
-    echo "./$1"
-  else
-    echo "$srcdir/$1"
-  fi
+    case "$1" in
+       */*)
+         echo "$1"
+         ;;
+       *)
+         if [ -x "$1" ] ; then
+             echo "./$1"
+         else
+             echo "$srcdir/$1"
+         fi
+         ;;
+    esac
 }
 
 env_program () {