Some shells set $_ to an absolute path.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 1 Sep 2013 13:40:59 +0000 (15:40 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 1 Sep 2013 13:40:59 +0000 (15:40 +0200)
test/testlib.sh

index e65127d..635bafe 100644 (file)
@@ -8,9 +8,18 @@ sptps_test=../src/sptps_test
 
 # Test directories
 
-d1=$PWD/$_.1
-d2=$PWD/$_.2
-d3=$PWD/$_.3
+case "$_" in
+       /*)
+               d1=$_.1
+               d2=$_.2
+               d3=$_.3
+       ;;
+       *)
+               d1=$PWD/$_.1
+               d2=$PWD/$_.2
+               d3=$PWD/$_.3
+       ;;
+esac
 
 # Remove test directories