Make sure that $d is always an absolute path, even if vg-in-place has been started without specifying a path. Furthermore, vg-in-place now also works when started from a path containing spaces.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8729 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/vg-in-place b/vg-in-place
index 86df128..0f58ed1 100755
--- a/vg-in-place
+++ b/vg-in-place
@@ -1,11 +1,14 @@
#!/bin/sh
# This ensures it works when invoked from any directory.
-d=`dirname $0`
+d="`dirname $0`"
+if [ "$d" = "." ]; then
+ d="$PWD"
+fi
# We set both VALGRIND_LIB and VALGRIND_LIB_INNER to handle normal and
# 'inner' builds.
-VALGRIND_LIB=$d/.in_place \
- VALGRIND_LIB_INNER=$d/.in_place \
- $d/coregrind/valgrind "$@"
+VALGRIND_LIB="$d/.in_place" \
+ VALGRIND_LIB_INNER="$d/.in_place" \
+ "$d/coregrind/valgrind" "$@"