Skip to content

Commit

Permalink
Catch our explicit EOF 0x04
Browse files Browse the repository at this point in the history
We pass in `"\x04"` as an EOF character in our tests, so let's ensure
that we handle that as an EOF in `getpass()`.
  • Loading branch information
staticfloat committed Jun 17, 2022
1 parent 65847ed commit a0d109d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function getpass(input::TTY, output::IO, prompt::AbstractString)
plen = 0
while true
c = _getch()
if c == 0xff || c == UInt8('\n') || c == UInt8('\r')
if c == 0xff || c == UInt8('\n') || c == UInt8('\r') || c == 0x04
break # EOF or return
elseif c == 0x00 || c == 0xe0
_getch() # ignore function/arrow keys
Expand Down

0 comments on commit a0d109d

Please sign in to comment.