aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_and_catch_crashes21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/run_and_catch_crashes b/test/run_and_catch_crashes
index 61738a135a..b3681c8391 100755
--- a/test/run_and_catch_crashes
+++ b/test/run_and_catch_crashes
@@ -19,8 +19,27 @@ then
#
# Core dumped - try to get a stack trace.
#
- # First, find the executable.
+ # First, find the executable. Skip past env and any env
+ # arguments to find the actual executable path. (If you
+ # run a program with an explicit path, and it dumps core,
+ # at least on Solaris the output of "file" on the core dump
+ # will not give the path, so we don't use that.)
#
+ if [ "$1" = "env" ]
+ then
+ #
+ # Skip past the env command name.
+ #
+ shift
+ #
+ # Skip past environment-variable arguments; anything
+ # with an "=" in it is an environment-variable argument.
+ #
+ while expr "$1" : ".*=.*" >/dev/null 2>&1
+ do
+ shift
+ done
+ fi
if [ -x "$1" ]
then
executable="$1"