mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-19 10:12:50 +08:00
Use StringComparison.Ordinal instead of culture-sensitive comparisons
This commit is contained in:
parent
04610cf492
commit
baa8220a52
@ -52,12 +52,12 @@ public sealed class TextPath : IRenderable, IHasJustification
|
|||||||
_parts = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
_parts = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
// Rooted Unix path?
|
// Rooted Unix path?
|
||||||
if (path.StartsWith("/"))
|
if (path.StartsWith("/", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
_rooted = true;
|
_rooted = true;
|
||||||
_parts = new[] { "/" }.Concat(_parts).ToArray();
|
_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 Windows path
|
||||||
_rooted = true;
|
_rooted = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user