chiark / gitweb /
bash-completion: use a better definition of __contains_word
[elogind.git] / shell-completion / bash / timedatectl
index 2842b3106925d81fb470f670b1cd439a748792f6..c6a6545257215201cf0f75cd0a0fe5eb888c6809 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
 }
 
 _timedatectl() {