From b3ae9dc3906ffdf38001fec9611e9d47db36f2e8 Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Thu, 1 Feb 2024 17:56:05 +0200 Subject: [PATCH] Fix Find() when / is used as input Fix #199 --- platformifier/fs.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platformifier/fs.go b/platformifier/fs.go index 9c977a2..c53d4cf 100644 --- a/platformifier/fs.go +++ b/platformifier/fs.go @@ -7,6 +7,7 @@ import ( "os" "path" "path/filepath" + "strings" "golang.org/x/exp/slices" ) @@ -53,6 +54,7 @@ func (f *OSFileSystem) Find(root, name string, firstMatch bool) []string { if root == "" { root = "." } + root = strings.TrimPrefix(root, "/") found := make([]string, 0) _ = fs.WalkDir(f.readonly(), root, func(p string, d os.DirEntry, err error) error { if err != nil {