a3e0f4f2afe03a207b98d4c0aaecb5bbaa796883

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

fix(lib): make opts local in omz_urlencode to fix scoping bug

Fixes error message when using zplug, due to $opts having been declared
as an associative array:

  omz_urlencode:2: bad set of key/value pairs for associative array

Fixes #9429

Diff

 1diff --git a/lib/functions.zsh b/lib/functions.zsh
 2index 58f0e3fb097ce8c98d474abb5b71cb028dbf00c9..15526cd5f221b3c0ecad6488a81a77c25c41745b 100644
 3--- a/lib/functions.zsh
 4+++ b/lib/functions.zsh
 5@@ -134,6 +134,7 @@ zmodload zsh/langinfo
 6 #    -P causes spaces to be encoded as '%20' instead of '+'
 7 function omz_urlencode() {
 8   emulate -L zsh
 9+  local -a opts
10   zparseopts -D -E -a opts r m P
11 
12   local in_str=$1