Skip to content

Commit 284df27

Browse files
committed
fix(_comp_delimited,cvs): add guards against set -o nounset
1 parent 13c28e9 commit 284df27

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

bash_completion

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,8 @@ _comp_delimited()
827827
fi
828828
done
829829
done
830-
COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "${cur##*"$delimiter"}"))
830+
((${#COMPREPLY[@]})) &&
831+
COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "${cur##*"$delimiter"}"))
831832
fi
832833
else
833834
COMPREPLY=($(compgen "$@" -- "${cur##*"$delimiter"}"))

completions/cvs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ _comp_xfunc_cvs_roots()
4141
[[ -v CVSROOT ]] && cvsroots=("$CVSROOT")
4242
[[ -r ~/.cvspass ]] && cvsroots+=($(awk '{ print $2 }' ~/.cvspass))
4343
[[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots <CVS/Root
44-
COMPREPLY=($(compgen -W '"${cvsroots[@]}"' -- "$cur"))
44+
((${#cvsroots[@]})) &&
45+
COMPREPLY=($(compgen -W '"${cvsroots[@]}"' -- "$cur"))
4546
__ltrim_colon_completions "$cur"
4647
}
4748

0 commit comments

Comments
 (0)