Use right variable name to avoid zero-length array

This fixes the typographic error that always assigned an undefined
array to `$names`, which made `$list_size` = 0 and triggered a
divide by zero error on the next line.
master
Marc Cornellà 11 years ago
parent 192de6bcff
commit 88243b846a
  1. 2
      plugins/emoji/emoji.plugin.zsh

@ -255,7 +255,7 @@ function random_emoji() {
if [[ -z "$group" || "$group" == "all" ]]; then
names=(${(k)emoji})
else
names=(${=emoji_groups[$group_name]})
names=(${=emoji_groups[$group]})
fi
local list_size=$#names
local random_index=$(( ( RANDOM % $list_size ) + 1 ))

Loading…
Cancel
Save