浏览代码

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.
Marc Cornellà 9 年之前
父节点
当前提交
88243b846a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/emoji/emoji.plugin.zsh

+ 1 - 1
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 ))