*_tilde*: Escape tilde in [[ $1 == \~* ]] tests (RedHat: #817902).
This commit is contained in:
parent
d141f9c6eb
commit
709d6e0690
@ -920,7 +920,7 @@ _ncpus()
|
|||||||
_tilde()
|
_tilde()
|
||||||
{
|
{
|
||||||
local result=0
|
local result=0
|
||||||
if [[ $1 == ~* && $1 != */* ]]; then
|
if [[ $1 == \~* && $1 != */* ]]; then
|
||||||
# Try generate ~username completions
|
# Try generate ~username completions
|
||||||
COMPREPLY=( $( compgen -P '~' -u "${1#\~}" ) )
|
COMPREPLY=( $( compgen -P '~' -u "${1#\~}" ) )
|
||||||
result=${#COMPREPLY[@]}
|
result=${#COMPREPLY[@]}
|
||||||
@ -956,7 +956,7 @@ _tilde()
|
|||||||
__expand_tilde_by_ref()
|
__expand_tilde_by_ref()
|
||||||
{
|
{
|
||||||
# Does $1 start with tilde (~)?
|
# Does $1 start with tilde (~)?
|
||||||
if [[ ${!1} == ~* ]]; then
|
if [[ ${!1} == \~* ]]; then
|
||||||
# Does $1 contain slash (/)?
|
# Does $1 contain slash (/)?
|
||||||
if [[ ${!1} == */* ]]; then
|
if [[ ${!1} == */* ]]; then
|
||||||
# Yes, $1 contains slash;
|
# Yes, $1 contains slash;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user