@@ -339,12 +339,12 @@ _comp_expand_glob()
339339# generated.
340340_comp_split ()
341341{
342- local _append=false IFS=$' \t\n '
342+ local _append=" " IFS=$' \t\n '
343343
344344 local OPTIND=1 OPTARG=" " OPTERR=0 _opt
345345 while getopts ' :alF:' _opt " $@ " ; do
346346 case $_opt in
347- a) _append=true ;;
347+ a) _append=set ;;
348348 l) IFS=$' \n ' ;;
349349 F) IFS=$OPTARG ;;
350350 * )
@@ -367,7 +367,7 @@ _comp_split()
367367 set -o noglob
368368
369369 local _old_size _new_size
370- if " $_append " ; then
370+ if [[ $_append ]] ; then
371371 eval " $1 +=()" # in case $1 is unset
372372 eval " _old_size=\$ {#$1 [@]}"
373373 eval " $1 +=(\$ 2)"
@@ -409,13 +409,13 @@ _comp_split()
409409# array instead.
410410_comp_compgen ()
411411{
412- local _append=false IFS=$' \t\n '
412+ local _append=" " IFS=$' \t\n '
413413 local -a _split_options=(-l)
414414
415415 local OPTIND=1 OPTARG=" " OPTERR=0 _opt
416416 while getopts ' :alF:' _opt " $@ " ; do
417417 case $_opt in
418- a) _append=true _split_options+=(-a) ;;
418+ a) _append=set _split_options+=(-a) ;;
419419 l) IFS=$' \n ' ;;
420420 F) IFS=$OPTARG ;;
421421 * )
@@ -447,7 +447,7 @@ _comp_compgen()
447447 local _result
448448 _result=$( compgen " ${@: 2} " ) || {
449449 local _status=$?
450- if " $_append " ; then
450+ if [[ $_append ]] ; then
451451 # make sure existence of variable
452452 eval -- " $1 +=()"
453453 else
@@ -859,16 +859,16 @@ _variables()
859859# -k: do not filter out already present tokens in value
860860_comp_delimited ()
861861{
862- local prefix=" " delimiter=$1 deduplicate=true
862+ local prefix=" " delimiter=$1 deduplicate=set
863863 shift
864864 if [[ $delimiter == -k ]]; then
865- deduplicate=false
865+ deduplicate=" "
866866 delimiter=$1
867867 shift
868868 fi
869869 [[ $cur == * $delimiter * ]] && prefix=${cur% " $delimiter " * } $delimiter
870870
871- if $deduplicate ; then
871+ if [[ $deduplicate ]] ; then
872872 # We could construct a -X pattern to feed to compgen, but that'd
873873 # conflict with possibly already set -X in $@, as well as have
874874 # glob char escaping issues to deal with. Do removals by hand instead.
@@ -1959,7 +1959,7 @@ _known_hosts_real()
19591959 local OPTIND=1
19601960 while getopts " ac46F:p:" flag " $@ " ; do
19611961 case $flag in
1962- a) aliases=' yes ' ;;
1962+ a) aliases=set ;;
19631963 c) suffix=' :' ;;
19641964 F)
19651965 if [[ ! $OPTARG ]]; then
@@ -1969,8 +1969,8 @@ _known_hosts_real()
19691969 configfile=$OPTARG
19701970 ;;
19711971 p) prefix=$OPTARG ;;
1972- 4) ipv4=1 ;;
1973- 6) ipv6=1 ;;
1972+ 4) ipv4=set ;;
1973+ 6) ipv6=set ;;
19741974 * )
19751975 echo " bash_completion: $FUNCNAME : usage error" >&2
19761976 return 1
0 commit comments