From 9f5ab47ebca77ffe83ff83685ebf55bd3b0cd773 Mon Sep 17 00:00:00 2001 From: Abhishek Shroff Date: Sat, 10 May 2025 23:43:43 +0530 Subject: [PATCH] [server][core] Fox targetNameParentByPathWithRoot --- server/internal/core/fs/find.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/internal/core/fs/find.go b/server/internal/core/fs/find.go index 8b1c92ca..d8e69219 100644 --- a/server/internal/core/fs/find.go +++ b/server/internal/core/fs/find.go @@ -94,7 +94,8 @@ func (f filesystem) targetNameParentByPathWithRoot(path string, src Resource) (s f = f.withPathRoot(pgtype.UUID{Bytes: src.id, Valid: true}) } - i := strings.LastIndex(strings.TrimRight(path, "/"), "/") + path = strings.TrimRight(path, "/") + i := strings.LastIndex(path, "/") parentPath := "" if i > 0 { parentPath = path[i:]