Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit dc1bb42

Browse files
Fixing some string comparisons
1 parent b1403ec commit dc1bb42

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/GitHub.Api/IO/NiceIO.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
using System;
2929
using System.Collections.Generic;
30+
using System.Globalization;
3031
using System.Linq;
3132
using System.Text;
3233

@@ -463,8 +464,8 @@ public int CompareTo(object obj)
463464

464465
public bool HasExtension(params string[] extensions)
465466
{
466-
var extensionWithDotLower = ExtensionWithDot.ToLower();
467-
return extensions.Any(e => WithDot(e).ToLower() == extensionWithDotLower);
467+
var extensionWithDotLower = ExtensionWithDot.ToLower(CultureInfo.InvariantCulture);
468+
return extensions.Any(e => WithDot(e).ToLower(CultureInfo.InvariantCulture) == extensionWithDotLower);
468469
}
469470

470471
private static string WithDot(string extension)

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public bool IsGitLfsExtracted()
9999
var calculateMd5 = environment.FileSystem.CalculateMD5(GitLfsExecutablePath);
100100
logger.Trace("GitLFS MD5: {0}", calculateMd5);
101101
var md5 = environment.IsWindows ? WindowsGitLfsExecutableMD5 : MacGitLfsExecutableMD5;
102-
if (String.Compare(calculateMd5, md5, true) != 0)
102+
if (md5.Equals(calculateMd5, StringComparison.InvariantCultureIgnoreCase))
103103
{
104104
logger.Trace("{0} has incorrect MD5", GitExecutablePath);
105105
return false;

0 commit comments

Comments
 (0)