Skip to content

Commit 3d7a1ba

Browse files
committed
Make var assignment local
1 parent 8ce435b commit 3d7a1ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gnu

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ _gnu_unload() {
104104

105105
# Used to remove or prepend entries from PATH / MANPATH
106106
_gnu_pathspec() {
107-
pathvar="$1" # PATH or MANPATH
108-
action="$2" # + to prepend and cleanup, - to cleanup (remove) only
109-
exclude="$3" # path to be added / cleaned from the env var
110-
if [ "$action" == '+' ]; then add="$3:"; else add=''; fi
107+
local pathvar="$1" # PATH or MANPATH
108+
local action="$2" # + to prepend and cleanup, - to cleanup (remove) only
109+
local exclude="$3" # path to be added / cleaned from the env var
110+
local add=''; if [ "$action" == '+' ]; then add="$3:"; fi
111111
echo -n 'export '$pathvar'="'$add'$('
112112
echo -n 'echo "$'$pathvar'"' # Gets PATH / MANPATH in : format
113113
echo -n "|tr : '\n'" # Turns : into newlines

0 commit comments

Comments
 (0)