mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 13:50:09 +00:00
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.
This commit is contained in:
parent
192de6bcff
commit
88243b846a
1 changed files with 1 additions and 1 deletions
|
@ -255,7 +255,7 @@ function random_emoji() {
|
||||||
if [[ -z "$group" || "$group" == "all" ]]; then
|
if [[ -z "$group" || "$group" == "all" ]]; then
|
||||||
names=(${(k)emoji})
|
names=(${(k)emoji})
|
||||||
else
|
else
|
||||||
names=(${=emoji_groups[$group_name]})
|
names=(${=emoji_groups[$group]})
|
||||||
fi
|
fi
|
||||||
local list_size=$#names
|
local list_size=$#names
|
||||||
local random_index=$(( ( RANDOM % $list_size ) + 1 ))
|
local random_index=$(( ( RANDOM % $list_size ) + 1 ))
|
||||||
|
|
Loading…
Reference in a new issue