diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-05-11 12:22:23 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-05-11 19:23:05 +0000 |
commit | 5a9d065f1bf1ca10c00bc5373d4a0b77d1997863 (patch) | |
tree | dfd4c2ec1c155b398e9a4446c22a44758c193eb6 | |
parent | e37ae1000dc133f33eb7aa61904e7d28f9870723 (diff) |
Skip past env and its environment-variable arguments.
Change-Id: Ic0bec27e5884a1e5db8e98e6d84b677ae8b2d377
Reviewed-on: https://code.wireshark.org/review/8403
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rwxr-xr-x | test/run_and_catch_crashes | 21 |
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" |