Bugfix: _list() cannot handle filter TERM starting with space.
Added proper quoting at check for search term starting with a dash. Added tests for ls use with TERM, both with literal text and regexps. Seems that use case was missing from the tests so far. Extra: Removed unnecessary "$@" argument to for() loop.
This commit is contained in:
4
todo.sh
4
todo.sh
@@ -515,10 +515,10 @@ _list() {
|
||||
## Prefix the filter_command with the pre_filter_command
|
||||
filter_command="${pre_filter_command:-}"
|
||||
|
||||
for search_term in "$@"
|
||||
for search_term
|
||||
do
|
||||
## See if the first character of $search_term is a dash
|
||||
if [ ${search_term:0:1} != '-' ]
|
||||
if [ "${search_term:0:1}" != '-' ]
|
||||
then
|
||||
## First character isn't a dash: hide lines that don't match
|
||||
## this $search_term
|
||||
|
||||
Reference in New Issue
Block a user