Should be tested on bash < 4; on bash4 it gave:
awk: /^[[:space:]]*Channel/ {print $4\"G\"}
awk: ^ backslash not last character on line
(similarly for "rate")
This fixes a bug under bash-4 where completing:
scp -F 'spaced conf' <TAB>
causes `dequote' to yield errors:
bash: eval: line 1: unexpected EOF while looking for matching `''
bash: eval: line 2: syntax error: unexpected end of file
The bug occurs because of a bug in bash-4.0, where quoted words are split
unintended, see: http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html
Workaround is now to silence `dequote' in case of errors and wait for bash-4 to
be fixed...
Reverting yesterdays commit d3187b6f3 (Bugfix completing scp/sftp/ssh -F '' on bash-4), which said:
set -- "${COMP_LINE:0:$COMP_POINT}"
The problem with the line above is that it needs to be unquoted for `set' in order to break up COMP_LINE into separate arguments:
set -- ${COMP_LINE:0:$COMP_POINT}
But this will yield error "unexpected EOF while looking for matching `''" if COMP_LINE is containing unbalanced single/double quotes, e.g.:
eval set -- scp -F 'config
Use ${COMP_LINE:0:$COMP_POINT} instead of ${COMP_WORDS[@]} when searching for
-F configfile in scp/sftp/ssh. This fixes a bug under bash-4 where completing:
scp -F 'spaced conf' <TAB>
causes `dequote' to yield errors:
bash: eval: line 1: unexpected EOF while looking for matching `''
bash: eval: line 2: syntax error: unexpected end of file
The bug occurs because of a bug in bash-4.0, where quoted words are split
unintended, see: http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html
Also, using ${COMP_LINE:0:$COMP_POINT} is an improvement, because it takes the
current cursor position into account.
Changed `out' parameter of `assert_bash_exec()' to accept also -1 and 0:
@param mixed $out (optional) Reference to variable to hold output.
If variable equals -1 (default) the bash command is
expected to return no output. If variable equals 0,
any output from the bash command is disregarded.
This fixes the situation of commit cfcf9fa where contrib/ri was causing
invisible errors when running the test suite.