diff --git a/src/mscorlib/shared/System/IO/PathHelper.Windows.cs b/src/mscorlib/shared/System/IO/PathHelper.Windows.cs index 2b17fff091a7..ed49422c1ad3 100644 --- a/src/mscorlib/shared/System/IO/PathHelper.Windows.cs +++ b/src/mscorlib/shared/System/IO/PathHelper.Windows.cs @@ -56,7 +56,7 @@ internal static string Normalize(ref ValueStringBuilder path) // Get the full path GetFullPathName(path.AsSpan(terminate: true), ref builder); - string result = builder.AsSpan().Contains('~') + string result = builder.AsSpan().IndexOf('~') >= 0 ? TryExpandShortFileName(ref builder, originalPath: null) : builder.ToString();