Skip to content

Commit

Permalink
Fix assertion in prim_tty
Browse files Browse the repository at this point in the history
The reader updates the Unicode state right before checking the input's encoding, but the assertion that encoding errors are only possible when using utf8 was done against the original state.
  • Loading branch information
dszoboszlay authored May 22, 2024
1 parent 945c940 commit b1766e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kernel/src/prim_tty.erl
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ reader_loop(TTY, Parent, SignalRef, ReaderRef, FromEnc, Acc) ->
{error, B, Error} ->
%% We should only be able to get incorrect encoded data when
%% using utf8
FromEnc = utf8,
UpdatedFromEnc = utf8,
Parent ! {self(), set_unicode_state, false},
receive
{set_unicode_state, false} ->
Expand Down

0 comments on commit b1766e0

Please sign in to comment.