Skip to content

Commit

Permalink
Safer unfunction params
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmc3 committed Dec 3, 2023
1 parent eecb346 commit eb5e06e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion functions/__antidote_setup
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
for fn in ${0:A:h}/*; do
[[ ${fn:t} != '__antidote_setup' ]] || continue
if typeset -f ${fn:t} > /dev/null; then
unfunction ${fn:t}
unfunction -- ${fn:t}
fi

# autoload extensionless function files
Expand Down
2 changes: 1 addition & 1 deletion tests/functions/t_teardown
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function t_teardown {

# unfunction all antidote
for fn in ${(k)functions}; do
[[ $fn == *antidote* ]] && unfunction $fn
[[ $fn == *antidote* ]] && unfunction -- $fn
done
(( $+functions[git] )) && unfunction git

Expand Down

0 comments on commit eb5e06e

Please sign in to comment.