From 88243b846adc61c3e34a60f4c0ae53e3eb8b9e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 16 Aug 2015 22:26:33 +0200 Subject: [PATCH] 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. --- plugins/emoji/emoji.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emoji/emoji.plugin.zsh b/plugins/emoji/emoji.plugin.zsh index a98d0b714..adb11bb53 100644 --- a/plugins/emoji/emoji.plugin.zsh +++ b/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 ))