Fix for nested subdirs



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6343 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/perf/vg_perf.in b/perf/vg_perf.in
index 8f85902..129d8c4 100644
--- a/perf/vg_perf.in
+++ b/perf/vg_perf.in
@@ -353,6 +353,8 @@
     my ($dir, $prev_dirs) = @_;
     $dir =~ s/\/$//;    # trim a trailing '/'
 
+    chomp(my $initial_dir = `pwd`);     # record where we started
+
     # Ignore dirs into which we should not recurse.
     if ($dir =~ /^(BitKeeper|CVS|SCCS|docs|doc)$/) { return; }
 
@@ -379,7 +381,7 @@
         print "-- Finished tests in $full_dir $dashes\n";
     }
 
-    chdir("..");
+    chdir("$initial_dir");
 }
 
 #----------------------------------------------------------------------------