aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO/ManagedFileSystem.cs
diff options
context:
space:
mode:
authorPithaya <19533412+Pithaya@users.noreply.github.com>2023-11-13 18:07:23 +0100
committerGitHub <noreply@github.com>2023-11-13 18:07:23 +0100
commiteb2bcc91c5e8182bddf1ab5d6ee2a951da66e9c6 (patch)
tree97bf08a7c3f3ebae72c0c89ffccd2917fad3cb2c /Emby.Server.Implementations/IO/ManagedFileSystem.cs
parent948a67cfeb1aa045099c4486da4eb1fd459a676f (diff)
parentea546230586a00a75db5c379db904e47cbbf270b (diff)
Merge branch 'master' into feat/book-persons
Diffstat (limited to 'Emby.Server.Implementations/IO/ManagedFileSystem.cs')
-rw-r--r--Emby.Server.Implementations/IO/ManagedFileSystem.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
index 18b00ce0b..c380d67db 100644
--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
@@ -91,7 +91,7 @@ namespace Emby.Server.Implementations.IO
}
// unc path
- if (filePath.StartsWith("\\\\", StringComparison.Ordinal))
+ if (filePath.StartsWith(@"\\", StringComparison.Ordinal))
{
return filePath;
}
@@ -103,15 +103,17 @@ namespace Emby.Server.Implementations.IO
return filePath;
}
+ var filePathSpan = filePath.AsSpan();
+
// relative path
if (firstChar == '\\')
{
- filePath = filePath.Substring(1);
+ filePathSpan = filePathSpan.Slice(1);
}
try
{
- return Path.GetFullPath(Path.Combine(folderPath, filePath));
+ return Path.GetFullPath(Path.Join(folderPath, filePathSpan));
}
catch (ArgumentException)
{