bug: Use C style strings when checking for invalid alias characters (#2188)

* Use C style strings when checking for invalid alias characters

Before, the '\n' would be interpreted as 'n' meaning that any alias
who's command contained the letter 'n' would incorrect be skipped.

* No need to escape characters in this context

Escaping was just adding \ to the list multiple times

Co-authored-by: David Farrell <davidpfarrell+github@gmail.com>
This commit is contained in:
BF
2023-01-25 17:56:14 -06:00
committed by GitHub
parent 66ae9b0de8
commit feb468b517

View File

@@ -50,7 +50,7 @@ function _bash-it-component-completion-callback-on-init-aliases() {
fi fi
# skip aliases to pipes, boolean control structures and other command lists # skip aliases to pipes, boolean control structures and other command lists
chars='\|\&\;\)\(\n\<\>' chars=$'|&;()<>\n'
if [[ "${alias_defn}" =~ [$chars] ]]; then if [[ "${alias_defn}" =~ [$chars] ]]; then
continue continue
fi fi