Fixed infinite loop in ini config adapter

If parseFile recived a directory it would go into a infinit loop
This commit is contained in:
Simon Rawet 2016-03-12 00:20:19 +01:00
parent 88816348b9
commit 8b0957cf2e
1 changed files with 4 additions and 0 deletions

View File

@ -82,6 +82,10 @@ func (ini *IniConfig) parseFile(name string) (*IniConfigContainer, error) {
if err == io.EOF {
break
}
//It might be a good idea to throw a error on all unknonw errors?
if _, ok := err.(*os.PathError); ok {
return nil, err
}
if bytes.Equal(line, bEmpty) {
continue
}