From b52215184538991dfe1012c1017437edeb2e7b70 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 30 May 2026 18:24:50 -0500 Subject: remove the option to strip the root when getting directory --- src/slskd/Common/FileSafety.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/slskd/Common/FileSafety.cs b/src/slskd/Common/FileSafety.cs index 6c1ce8b6..acbe273b 100644 --- a/src/slskd/Common/FileSafety.cs +++ b/src/slskd/Common/FileSafety.cs @@ -247,22 +247,16 @@ public static class FileSafety /// each of the remaining segments. /// /// The path from which to extract the directory name. - /// An optional value indicating that root segments should not be stripped. /// An optional value indicating that path segments should not be sanitized. /// An optional operating system override, for testing. /// The directory name. /// Thrown if the specified path is null. - public static string GetDirectoryNameSafely(string path, bool stripRoot = true, bool sanitize = true, OSPlatform? os = null) + public static string GetDirectoryNameSafely(string path, bool sanitize = true, OSPlatform? os = null) { ArgumentNullException.ThrowIfNull(path); var local = LocalizePath(path, os: os); - if (stripRoot) - { - local = StripPathRoot(local); - } - return string.Join(Path.DirectorySeparatorChar, local .Split(Path.DirectorySeparatorChar) .SkipLast(1) -- cgit v1.2.3