Fixed bug 1
This commit is contained in:
		
							parent
							
								
									272452f813
								
							
						
					
					
						commit
						75568b8038
					
				
					 2 changed files with 9 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -15,8 +15,7 @@ active = false
 | 
			
		|||
 | 
			
		||||
[service-1]
 | 
			
		||||
port = 443
 | 
			
		||||
url = http://%(host)s/something
 | 
			
		||||
`
 | 
			
		||||
url = http://%(host)s/something`
 | 
			
		||||
 | 
			
		||||
type stringtest struct {
 | 
			
		||||
	section string
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										13
									
								
								read.go
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								read.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -48,13 +48,11 @@ func (c *ConfigFile) Read(reader io.Reader) (err os.Error) {
 | 
			
		|||
	var section, option string;
 | 
			
		||||
	section = "default"
 | 
			
		||||
	for {
 | 
			
		||||
		l, err := buf.ReadString('\n');	// parse line-by-line
 | 
			
		||||
		if err == os.EOF {
 | 
			
		||||
			break
 | 
			
		||||
		} else if err != nil {
 | 
			
		||||
		l, buferr := buf.ReadString('\n');	// parse line-by-line
 | 
			
		||||
		if buferr != nil && buferr != os.EOF {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		
 | 
			
		||||
		l = strings.TrimSpace(l);
 | 
			
		||||
		// switch written for readability (not performance)
 | 
			
		||||
		switch {
 | 
			
		||||
| 
						 | 
				
			
			@ -96,6 +94,11 @@ func (c *ConfigFile) Read(reader io.Reader) (err os.Error) {
 | 
			
		|||
				return ReadError{CouldNotParse, l}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// Reached end of file
 | 
			
		||||
		if buferr == os.EOF {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue