Merge pull request #1174 from meziantou/missing-stringcomparison

This commit is contained in:
Patrik Svensson 2023-02-22 16:03:29 +01:00 committed by GitHub
commit 819b948e78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;