diff options
Diffstat (limited to 'fst/path.go')
| -rw-r--r-- | fst/path.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fst/path.go b/fst/path.go new file mode 100644 index 00000000..2bdab87c --- /dev/null +++ b/fst/path.go @@ -0,0 +1,11 @@ +package fst + +import ( + "path/filepath" + "strings" +) + +func deepContainsH(basepath, targpath string) (bool, error) { + rel, err := filepath.Rel(basepath, targpath) + return err == nil && rel != ".." && !strings.HasPrefix(rel, string([]byte{'.', '.', filepath.Separator})), err +} |
