From baa8220a522f865c1e17e7e46e510cb0eb974396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Mon, 20 Feb 2023 20:23:06 -0500 Subject: [PATCH] Use StringComparison.Ordinal instead of culture-sensitive comparisons --- src/Spectre.Console/Widgets/TextPath.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Spectre.Console/Widgets/TextPath.cs b/src/Spectre.Console/Widgets/TextPath.cs index 92c8471..db5eafc 100644 --- a/src/Spectre.Console/Widgets/TextPath.cs +++ b/src/Spectre.Console/Widgets/TextPath.cs @@ -52,12 +52,12 @@ public sealed class TextPath : IRenderable, IHasJustification _parts = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); // Rooted Unix path? - if (path.StartsWith("/")) + if (path.StartsWith("/", StringComparison.Ordinal)) { _rooted = true; _parts = new[] { "/" }.Concat(_parts).ToArray(); } - else if (_parts.Length > 0 && _parts[0].EndsWith(":")) + else if (_parts.Length > 0 && _parts[0].EndsWith(":", StringComparison.Ordinal)) { // Rooted Windows path _rooted = true;