]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - shell-completion/bash/systemd-analyze
bash-completion: use a better definition of __contains_word
[thirdparty/systemd.git] / shell-completion / bash / systemd-analyze
index 11276ef09cd68b1c75bec21c88702b4191257443..33833aac105f0c0351660dd6c13e14fe3da8d9a2 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
 }
 
 _systemd_analyze() {