From ce98f92b04af9bbe81308a22105c5ee59293b51d Mon Sep 17 00:00:00 2001 From: Andrew Po Date: Wed, 4 May 2016 18:01:25 +0300 Subject: [PATCH] Fixed panic in AddConfigPath --- util.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util.go b/util.go index 0cc4553..c178034 100644 --- a/util.go +++ b/util.go @@ -58,7 +58,11 @@ func absPathify(inPath string) string { if strings.HasPrefix(inPath, "$") { end := strings.Index(inPath, string(os.PathSeparator)) - inPath = os.Getenv(inPath[1:end]) + inPath[end:] + if end == -1 { + inPath = os.Getenv(inPath[1:]) + } else { + inPath = os.Getenv(inPath[1:end]) + inPath[end:] + } } if filepath.IsAbs(inPath) {