mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 10:13:14 -04:00 
			
		
		
		
	Use filepath when manipulating file paths (#2221)
Automatically submitted.
This commit is contained in:
		
				
					committed by
					
						![corbot[bot]](/avatar/1d4a95117f287d57533b964d8c88ebcf?size=40) corbot[bot]
						corbot[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							cf04223718
						
					
				
				
					commit
					4b1b0ec9e6
				
			| @@ -2,7 +2,7 @@ package file | ||||
|  | ||||
| import ( | ||||
| 	"os" | ||||
| 	"path" | ||||
| 	"path/filepath" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/coredns/coredns/core/dnsserver" | ||||
| @@ -71,8 +71,8 @@ func fileParse(c *caddy.Controller) (Zones, error) { | ||||
| 			origins = args | ||||
| 		} | ||||
|  | ||||
| 		if !path.IsAbs(fileName) && config.Root != "" { | ||||
| 			fileName = path.Join(config.Root, fileName) | ||||
| 		if !filepath.IsAbs(fileName) && config.Root != "" { | ||||
| 			fileName = filepath.Join(config.Root, fileName) | ||||
| 		} | ||||
|  | ||||
| 		reader, err := os.Open(fileName) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user