lib: Introduce fs.IsParent (fixes #5324) (#5326)

This commit is contained in:
Simon Frei
2018-11-22 11:16:45 +01:00
committed by Jakob Borg
parent 513d3bc374
commit 2f9840ddae
6 changed files with 19 additions and 11 deletions

View File

@@ -336,7 +336,7 @@ func loadParseIncludeFile(filesystem fs.Filesystem, file string, cd ChangeDetect
if filesystem.Type() == fs.FilesystemTypeBasic {
uri := filesystem.URI()
joined := filepath.Join(uri, file)
if !strings.HasPrefix(joined, uri) {
if !fs.IsParent(joined, uri) {
filesystem = fs.NewFilesystem(filesystem.Type(), filepath.Dir(joined))
file = filepath.Base(joined)
}