Clear args before source in autoenv
This commit is contained in:
@@ -246,6 +246,8 @@ _autoenv_enter() {
|
|||||||
(( ${+_autoenv_entered[${_autoenv_entered[(i)$entered]}]} )) && return
|
(( ${+_autoenv_entered[${_autoenv_entered[(i)$entered]}]} )) && return
|
||||||
# If the enter script is not authorized, return.
|
# If the enter script is not authorized, return.
|
||||||
_autoenv_authorized $entered/.enter || return
|
_autoenv_authorized $entered/.enter || return
|
||||||
|
# Clear positional parameters so they don't leak into the sourced script.
|
||||||
|
set --
|
||||||
# Source the enter script.
|
# Source the enter script.
|
||||||
source $entered/.enter
|
source $entered/.enter
|
||||||
# Add the entered directory to the global entered array.
|
# Add the entered directory to the global entered array.
|
||||||
@@ -258,6 +260,8 @@ _autoenv_exit() {
|
|||||||
local entered=$1
|
local entered=$1
|
||||||
# If the exit script is not authorized, return.
|
# If the exit script is not authorized, return.
|
||||||
_autoenv_authorized $entered/.exit || return
|
_autoenv_authorized $entered/.exit || return
|
||||||
|
# Clear positional parameters so they don't leak into the sourced script.
|
||||||
|
set --
|
||||||
# Source the exit script.
|
# Source the exit script.
|
||||||
source $entered/.exit
|
source $entered/.exit
|
||||||
# Remove the entered directory from the global entered array.
|
# Remove the entered directory from the global entered array.
|
||||||
|
|||||||
Reference in New Issue
Block a user