From 17492fc25aed1a323297b260b9ccec3e2b559481 Mon Sep 17 00:00:00 2001 From: LFDM <1986gh@gmail.com> Date: Sat, 4 Jan 2014 23:13:16 +0100 Subject: [PATCH] Do not leak local variables. --- oh-my-zsh.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index e343700f2..808f22734 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -15,6 +15,10 @@ check_for_updates() { # won't be added to the plugin_paths. find_plugin_paths() { ZSH_PLUGIN_PATHS=() + local plugin + local plugin_path + local zsh_path + for plugin ($plugins); do plugin_path="plugins/$plugin/$plugin.plugin.zsh" for zsh_path in $ZSH_CUSTOM $ZSH; do @@ -46,6 +50,7 @@ initialize_completions() { } source_files() { + local file for file in $@; do source $file done @@ -69,7 +74,7 @@ _source_zsh_theme() { elif [ ! "$ZSH_THEME" = "" ]; then # custom themes take precedence over built-in themes! for zsh_path in $ZSH_CUSTOM $ZSH; do - theme_path="themes/$ZSH_THEME.zsh-theme" + local theme_path="themes/$ZSH_THEME.zsh-theme" if [ -f "$zsh_path/$theme_path" ]; then source "$zsh_path/$theme_path" break