Use filepath when manipulating file paths (#2221)

Automatically submitted.
This commit is contained in:
Manuel Stocker
2018-10-21 15:59:37 +02:00
committed by corbot[bot]
parent cf04223718
commit 4b1b0ec9e6
10 changed files with 32 additions and 33 deletions

View File

@@ -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 {