test-xalloc-die.sh: fix a portability bug
authorJim Meyering <meyering@redhat.com>
Tue, 17 Nov 2009 07:42:58 +0000 (08:42 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 17 Nov 2009 07:42:58 +0000 (08:42 +0100)
* tests/test-xalloc-die.sh: Do not invoke via ./test-xalloc-die.
Instead, set PATH to start with "." and invoke via "test-xalloc-die".
Otherwise, argv[0] (as often seen in diagnostics) would be too
system-dependent, sometimes with, and sometimes without the leading "./".

ChangeLog
tests/test-xalloc-die.sh

index 8b1853e..1bfb249 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-11-17  Jim Meyering  <meyering@redhat.com>
 
+       test-xalloc-die.sh: fix a portability bug
+       * tests/test-xalloc-die.sh: Do not invoke via ./test-xalloc-die.
+       Instead, set PATH to start with "." and invoke via "test-xalloc-die".
+       Otherwise, argv[0] (as often seen in diagnostics) would be too
+       system-dependent, sometimes with, and sometimes without the leading "./".
+
        version-etc-fsf: relax license to LGPLv3+
        * modules/version-etc-fsf (License): Relax license.
 
index 340a500..53cdaeb 100755 (executable)
@@ -13,7 +13,9 @@ else
 fi
 
 tmpfiles="t-xalloc-die.tmp"
-./test-xalloc-die${EXEEXT} 2> t-xalloc-die.tmp
+PATH="$PATH:."
+export PATH
+test-xalloc-die${EXEEXT} 2> t-xalloc-die.tmp
 case $? in
   1) ;;
   *) (exit 1); exit 1 ;;