* [PATCH] git-prompt.sh: make $f local to __git_eread()
@ 2014-12-12 21:59 jguenther
0 siblings, 0 replies; only message in thread
From: jguenther @ 2014-12-12 21:59 UTC (permalink / raw)
To: git; +Cc: Felipe Contreras, Justin Guenther
From: Justin Guenther <jguenther@gmail.com>
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>
---
contrib/completion/git-prompt.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index c5473dc..729f769 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -270,7 +270,7 @@ __git_ps1_colorize_gitstring ()
__git_eread ()
{
- f="$1"
+ local f="$1"
shift
test -r "$f" && read "$@" <"$f"
}
--
2.2.0.37.g2035459
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-12 22:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-12 21:59 [PATCH] git-prompt.sh: make $f local to __git_eread() jguenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).