Index: testsuite/testing.sh
===================================================================
--- testsuite/testing.sh	(revision 21643)
+++ testsuite/testing.sh	(working copy)
@@ -53,6 +53,10 @@
 
 testing()
 {
+  local ECHO='echo -e'
+
+  [ -z "$($ECHO)" ] || ECHO='echo'
+
   NAME="$1"
   [ -z "$1" ] && NAME=$2
 
@@ -70,16 +74,16 @@
     return 0
   fi
 
-  echo -ne "$3" > expected
-  echo -ne "$4" > input
+  $ECHO -n "$3" > expected
+  $ECHO -n "$4" > input
   [ -z "$VERBOSE" ] || echo "echo '$5' | $2"
-  echo -ne "$5" | eval "$2" > actual
+  $ECHO -n "$5" | eval "$2" > actual
   RETVAL=$?
 
   cmp expected actual >/dev/null 2>/dev/null
   if [ $? -ne 0 ]
   then
-    FAILCOUNT=$[$FAILCOUNT+1]
+    FAILCOUNT=$(($FAILCOUNT + 1))
     echo "FAIL: $NAME"
     [ -n "$VERBOSE" ] && diff -u expected actual
   else
@@ -99,6 +103,8 @@
 
 mkchroot()
 {
+  local first_char=
+
   [ $# -lt 2 ] && return
 
   echo -n .
@@ -107,7 +113,9 @@
   shift
   for i in "$@"
   do
-    [ "${i:0:1}" == "/" ] || i=$(which $i)
+    first_char=${i#?}
+    first_char=${first_char%$first_char}
+    [ "$first_char" = / ] || i=$(which $i)
     [ -f "$dest/$i" ] && continue
     if [ -e "$i" ]
     then
@@ -151,4 +159,3 @@
   umount -l tmpdir4chroot
   rmdir tmpdir4chroot
 }
-
