chiark / gitweb /
bash-completion: use a better definition of __contains_word
[elogind.git] / shell-completion / bash / udevadm
index e9ad1792034ce787098fa13001a90bce7fc4d088..e521a3bbb696c47fa4fdefa3ee32edf2c036b893 100644 (file)
 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
 __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
 }
 
 __get_all_sysdevs() {