Skip to content

Commit

Permalink
Update IoHelpers.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Mar 14, 2024
1 parent 9292122 commit 08acaf9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Verify/IoHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ public static async Task<StringBuilder> ReadStringBuilderWithFixedLines(this Str
{
stream.MoveToStart();
using var reader = new StreamReader(stream);
var builder = new StringBuilder(await reader.ReadToEndAsync());
builder.FixNewlines();
var contents = await reader.ReadToEndAsync();
var builder = new StringBuilder(contents);
if (contents.Contains('\n'))
{
builder.FixNewlines();
}

return builder;
}
Expand Down

0 comments on commit 08acaf9

Please sign in to comment.