Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FlushAsyncInternal when emitting BOM #52812

Merged
merged 2 commits into from
May 26, 2021
Merged

Fix FlushAsyncInternal when emitting BOM #52812

merged 2 commits into from
May 26, 2021

Conversation

meziantou
Copy link
Contributor

Fix #52811

@ghost
Copy link

ghost commented May 15, 2021

Tagging subscribers to this area: @carlossanlop
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #52811

Author: meziantou
Assignees: -
Labels:

area-System.IO

Milestone: -

Update StreamWriter.WriteTests.cs
Update StreamWriter.WriteTests.cs
@meziantou meziantou marked this pull request as ready for review May 15, 2021 18:30
@meziantou
Copy link
Contributor Author

The CI failed, but it doesn't seem to be related to my changes

Comment on lines 944 to 945
Task flushTask = Core(flushStream, flushEncoder, cancellationToken);

_charPos = 0;
return flushTask;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can now be:

return Core(flushStream, flushEncoder, cancellationToken);

The separation was just to be able to have the charPos = 0 in the middle, but that's now gone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, should be ok now

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks! I'm surprised this hasn't been found until now.

@stephentoub
Copy link
Member

cc: @GrabYourPitchforks

@GrabYourPitchforks
Copy link
Member

Nice find!

@stephentoub stephentoub merged commit 5f7ba2b into dotnet:main May 26, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete file when using StreamWriter / WriteLineAsync with .NET 6 preview 3
3 participants