From 03c6ab4c0f6c389f57d9db0ebdebbd53435dcb0d Mon Sep 17 00:00:00 2001 From: Andrey Mazo Date: Sun, 29 Jun 2014 00:25:56 +0400 Subject: [PATCH] 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. --- libexec/bats-exec-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/bats-exec-test b/libexec/bats-exec-test index b12d4c0..8abf50a 100755 --- a/libexec/bats-exec-test +++ b/libexec/bats-exec-test @@ -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"