mirror of
https://github.com/coredns/coredns.git
synced 2025-10-31 18:23:13 -04:00
Use filepath when manipulating file paths (#2221)
Automatically submitted.
This commit is contained in:
committed by
corbot[bot]
parent
cf04223718
commit
4b1b0ec9e6
@@ -2,7 +2,7 @@ package hosts
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -83,8 +83,8 @@ func hostsParse(c *caddy.Controller) (Hosts, error) {
|
||||
h.path = args[0]
|
||||
args = args[1:]
|
||||
|
||||
if !path.IsAbs(h.path) && config.Root != "" {
|
||||
h.path = path.Join(config.Root, h.path)
|
||||
if !filepath.IsAbs(h.path) && config.Root != "" {
|
||||
h.path = filepath.Join(config.Root, h.path)
|
||||
}
|
||||
s, err := os.Stat(h.path)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user