mirror of
https://github.com/sstephenson/bats.git
synced 2026-02-25 01:08:10 +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:
@@ -153,7 +153,7 @@ bats_print_stack_trace() {
|
||||
# inspired by Gentoo Portage die()
|
||||
failed_cmd="$(sed \
|
||||
-e "${failed_cmd_line}!d" \
|
||||
-e "${failed_cmd_line}s:^[ \t]\+::" \
|
||||
-e "${failed_cmd_line}s:^[ ][ ]*::" \
|
||||
-e "${failed_cmd_line}q" \
|
||||
"${failed_cmd_filename}")"
|
||||
echo "# \`${failed_cmd}' failed"
|
||||
|
||||
Reference in New Issue
Block a user