From 5a9d065f1bf1ca10c00bc5373d4a0b77d1997863 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 11 May 2015 12:22:23 -0700 Subject: Skip past env and its environment-variable arguments. Change-Id: Ic0bec27e5884a1e5db8e98e6d84b677ae8b2d377 Reviewed-on: https://code.wireshark.org/review/8403 Reviewed-by: Guy Harris --- test/run_and_catch_crashes | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'test/run_and_catch_crashes') 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" -- cgit v1.2.3