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,8 +58,12 @@ func absPathify(inPath string) string {
if strings.HasPrefix(inPath, "$") {
end := strings.Index(inPath, string(os.PathSeparator))
if end == -1 {
inPath = os.Getenv(inPath[1:])
} else {
inPath = os.Getenv(inPath[1:end]) + inPath[end:]
}
}
if filepath.IsAbs(inPath) {
return filepath.Clean(inPath)