Fixed panic in AddConfigPath

This commit is contained in:
Andrew Po 2016-05-04 18:01:25 +03:00
parent f904a17905
commit ce98f92b04

View file

@ -58,7 +58,11 @@ func absPathify(inPath string) string {
if strings.HasPrefix(inPath, "$") { if strings.HasPrefix(inPath, "$") {
end := strings.Index(inPath, string(os.PathSeparator)) 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) { if filepath.IsAbs(inPath) {