]> granicus.if.org Git - git/commitdiff
git-prompt.sh: make $f local to __git_eread()
authorJustin Guenther <jguenther@gmail.com>
Fri, 12 Dec 2014 21:59:56 +0000 (15:59 -0600)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Dec 2014 23:13:37 +0000 (15:13 -0800)
This function uses (non-local) $f to store the value of its first parameter.
This can interfere with the user's environment.

Signed-off-by: Justin Guenther <jguenther@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-prompt.sh

index 54489080f8ae25a4483cd4bae076942f47f53031..dba928ed00458cae9987e2bdbbad324827435ad3 100644 (file)
@@ -261,7 +261,7 @@ __git_ps1_colorize_gitstring ()
 
 eread ()
 {
-       f="$1"
+       local f="$1"
        shift
        test -r "$f" && read "$@" <"$f"
 }