mirror of
https://github.com/sstephenson/bats.git
synced 2024-11-17 11:42:33 +01:00
Fix backtrace sed script for non-GNU seds
Tested on GNU `sed --posix`. From `info sed`: `\+' As `*', but matches one or more. It is a GNU extension. `\CHAR' Matches CHAR, where CHAR is one of `$', `*', `.', `[', `\', or `^'. Note that the only C-like backslash sequences that you can portably assume to be interpreted are `\n' and `\\'; in particular `\t' is not portable, and matches a `t' under most implementations of `sed', rather than a tab character.
This commit is contained in:
parent
bbaf0f50df
commit
03c6ab4c0f
|
@ -153,7 +153,7 @@ bats_print_stack_trace() {
|
||||||
# inspired by Gentoo Portage die()
|
# inspired by Gentoo Portage die()
|
||||||
failed_cmd="$(sed \
|
failed_cmd="$(sed \
|
||||||
-e "${failed_cmd_line}!d" \
|
-e "${failed_cmd_line}!d" \
|
||||||
-e "${failed_cmd_line}s:^[ \t]\+::" \
|
-e "${failed_cmd_line}s:^[ ][ ]*::" \
|
||||||
-e "${failed_cmd_line}q" \
|
-e "${failed_cmd_line}q" \
|
||||||
"${failed_cmd_filename}")"
|
"${failed_cmd_filename}")"
|
||||||
echo "# \`${failed_cmd}' failed"
|
echo "# \`${failed_cmd}' failed"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user