chiark / gitweb /
bash-completion: use a better definition of __contains_word
[elogind.git] / shell-completion / bash / systemctl
index ceca3348eddc2d1c6dd23aafd5a2417459356cfa..517b49a6afda79ed587518cbf80431660d1f71bd 100644 (file)
@@ -32,9 +32,10 @@ __systemd_properties() {
 }
 
 __contains_word () {
-        local word=$1; shift
-        for w in $*; do [[ $w = $word ]] && return 0; done
-        return 1
+        local w word=$1; shift
+        for w in "$@"; do
+                [[ $w = "$word" ]] && return
+        done
 }
 
 __filter_units_by_property () {