aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-05-30 18:24:50 -0500
committerJP Dillingham <jp@dillingham.me>2026-05-30 18:24:50 -0500
commitb52215184538991dfe1012c1017437edeb2e7b70 (patch)
tree17d3329db618f8f9e685ec1be5577c0dce4547cd /src
parentba3d4690e132a966567db40c8b778c5ed3922833 (diff)
downloadslskd-b52215184538991dfe1012c1017437edeb2e7b70.tar.gz
remove the option to strip the root when getting directory
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Common/FileSafety.cs8
1 files changed, 1 insertions, 7 deletions
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.
/// </summary>
/// <param name="path">The path from which to extract the directory name.</param>
- /// <param name="stripRoot">An optional value indicating that root segments should not be stripped.</param>
/// <param name="sanitize">An optional value indicating that path segments should not be sanitized.</param>
/// <param name="os">An optional operating system override, for testing.</param>
/// <returns>The directory name.</returns>
/// <exception cref="ArgumentNullException">Thrown if the specified path is null.</exception>
- 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)