Fixed bug 1
This commit is contained in:
parent
272452f813
commit
75568b8038
|
@ -15,8 +15,7 @@ active = false
|
||||||
|
|
||||||
[service-1]
|
[service-1]
|
||||||
port = 443
|
port = 443
|
||||||
url = http://%(host)s/something
|
url = http://%(host)s/something`
|
||||||
`
|
|
||||||
|
|
||||||
type stringtest struct {
|
type stringtest struct {
|
||||||
section string
|
section string
|
||||||
|
|
11
read.go
11
read.go
|
@ -48,10 +48,8 @@ func (c *ConfigFile) Read(reader io.Reader) (err os.Error) {
|
||||||
var section, option string;
|
var section, option string;
|
||||||
section = "default"
|
section = "default"
|
||||||
for {
|
for {
|
||||||
l, err := buf.ReadString('\n'); // parse line-by-line
|
l, buferr := buf.ReadString('\n'); // parse line-by-line
|
||||||
if err == os.EOF {
|
if buferr != nil && buferr != os.EOF {
|
||||||
break
|
|
||||||
} else if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +94,11 @@ func (c *ConfigFile) Read(reader io.Reader) (err os.Error) {
|
||||||
return ReadError{CouldNotParse, l}
|
return ReadError{CouldNotParse, l}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reached end of file
|
||||||
|
if buferr == os.EOF {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue