summaryrefslogtreecommitdiffstats
path: root/shell-completion/bash/udevadm
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-07-30 18:46:23 +0200
committerDave Reisner <dreisner@archlinux.org>2013-07-30 19:04:46 +0200
commita72d698d0d9ff9c158155b44cdc77376df31a317 (patch)
tree3c80960a1404b44df57b200208664c206f96d8cf /shell-completion/bash/udevadm
parenttest-unit-file: return error without dumping core on permission error (diff)
downloadsystemd-a72d698d0d9ff9c158155b44cdc77376df31a317.tar.xz
systemd-a72d698d0d9ff9c158155b44cdc77376df31a317.zip
bash-completion: use a better definition of __contains_word
- scope the iterator var - use the correct, quoted, non-expansion prone positional parameter notation - prevent expansion on RHS of comparison - remove unneeded explicit returns. This really should be defined only once...
Diffstat (limited to 'shell-completion/bash/udevadm')
-rw-r--r--shell-completion/bash/udevadm7
1 files changed, 4 insertions, 3 deletions
diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm
index e9ad179203..e521a3bbb6 100644
--- a/shell-completion/bash/udevadm
+++ b/shell-completion/bash/udevadm
@@ -18,9 +18,10 @@
# 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() {