From: Ruben Beltran del Rio Date: Thu, 6 Feb 2025 20:59:06 +0000 (+0100) Subject: Account for the root X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain?ds=inline Account for the root --- diff --git a/internal/mobius/friendship_quest_file_extensions.go b/internal/mobius/friendship_quest_file_extensions.go index 98d82ff..c2d5d12 100644 --- a/internal/mobius/friendship_quest_file_extensions.go +++ b/internal/mobius/friendship_quest_file_extensions.go @@ -73,7 +73,8 @@ func handleFileTransaction(cc *hotline.ClientConn, t *hotline.Transaction, handl return nil } - resolvedPath, err := ResolveUserPath(cc, requestedPath[len(cc.FileRoot())+1:]) + sliceLen := min(len(cc.FileRoot()) + 1, len(requestedPath)) + resolvedPath, err := ResolveUserPath(cc, requestedPath[sliceLen:]) if err != nil { return cc.NewErrReply(t, errMsg) }