diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-09-03 16:16:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-03 16:16:58 -0500 |
| commit | 05ce3650a2afbfbc08c3903dccdec4a3526a3cd1 (patch) | |
| tree | be55213e82c9325e94b8e95f33e934e03c4512c9 /src/slskd/Core | |
| parent | 94d16f28dfc0228febc803fffd154357bd452a0f (diff) | |
| parent | 09345a8c1c1cf3f2bf29604d8653a68cc8b8c911 (diff) | |
| download | slskd-05ce3650a2afbfbc08c3903dccdec4a3526a3cd1.tar.gz | |
Merge pull request #627 from slskd/slashes
Normalize file path separators to backslashes
Diffstat (limited to 'src/slskd/Core')
| -rw-r--r-- | src/slskd/Core/Options.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 6a435db1..259977b6 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -363,16 +363,16 @@ namespace slskd { var results = new List<ValidationResult>(); - bool IsBlankPath(string share) => Regex.IsMatch(share.ToLocalOSPath(), @"^(!|-){0,1}(\[.*\])$"); + bool IsBlankPath(string share) => Regex.IsMatch(share.LocalizePath(), @"^(!|-){0,1}(\[.*\])$"); Shared.Where(share => IsBlankPath(share)).ToList() .ForEach(blank => results.Add(new ValidationResult($"Share {blank} doees not specify a path"))); - bool IsRootMount(string share) => Regex.IsMatch(share.ToLocalOSPath(), @"^(!|-){0,1}(\[.*\])/$"); + bool IsRootMount(string share) => Regex.IsMatch(share.LocalizePath(), @"^(!|-){0,1}(\[.*\])/$"); Shared.Where(share => IsRootMount(share)).ToList() .ForEach(blank => results.Add(new ValidationResult($"Share {blank} specifies a root mount, which is not supported."))); // starts with '/', 'X:', or '\\' - bool IsAbsolutePath(string share) => Regex.IsMatch(share.ToLocalOSPath(), @"^(!|-){0,1}(\[.*\])?(\/|[a-zA-Z]:|\\\\).*$"); + bool IsAbsolutePath(string share) => Regex.IsMatch(share.LocalizePath(), @"^(!|-){0,1}(\[.*\])?(\/|[a-zA-Z]:|\\\\).*$"); Shared.Where(share => !IsAbsolutePath(share)).ToList() .ForEach(relativePath => results.Add(new ValidationResult($"Share {relativePath} contains a relative path; only absolute paths are supported."))); |
