diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-09-02 22:31:33 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-09-02 22:31:33 -0500 |
| commit | 6cb9f1ccc72cad333dec5f7a7b0fdf5bc5691921 (patch) | |
| tree | 71fe57714bf68abf262f8433f77d797a10584f23 /src | |
| parent | 6735bf4f1b984055170130753788de67d648c7d7 (diff) | |
| download | slskd-6cb9f1ccc72cad333dec5f7a7b0fdf5bc5691921.tar.gz | |
LocalizePath()
Diffstat (limited to 'src')
| -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."))); |
