diff options
author | Daniel Pettersson <[email protected]> | 2017-07-05 23:35:58 +0200 |
---|---|---|
committer | Daniel Pettersson <[email protected]> | 2017-07-05 23:35:58 +0200 |
commit | 6be0ed124af615a3ea17d4f913649b50aef68821 (patch) | |
tree | 4bac467b45eb034dffeafccf92e9e1dac02807cf /lib/ssh/src | |
parent | 3da6adc679825d17ce65e7363af6554e5ee1661a (diff) | |
download | otp-6be0ed124af615a3ea17d4f913649b50aef68821.tar.gz otp-6be0ed124af615a3ea17d4f913649b50aef68821.tar.bz2 otp-6be0ed124af615a3ea17d4f913649b50aef68821.zip |
Add support for binary input in ssh_io
Diffstat (limited to 'lib/ssh/src')
-rw-r--r-- | lib/ssh/src/ssh_io.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_io.erl b/lib/ssh/src/ssh_io.erl index 8ba759ad60..a7cd1daeec 100644 --- a/lib/ssh/src/ssh_io.erl +++ b/lib/ssh/src/ssh_io.erl @@ -31,8 +31,8 @@ read_line(Prompt, Opts) -> format("~s", [listify(Prompt)]), ?GET_INTERNAL_OPT(user_pid, Opts) ! {self(), question}, receive - Answer when is_list(Answer) -> - Answer + Answer when is_list(Answer) or is_binary(Answer) -> + unicode:characters_to_list(Answer) end. yes_no(Prompt, Opts) -> @@ -44,7 +44,7 @@ yes_no(Prompt, Opts) -> y -> yes; n -> no; - Answer when is_list(Answer) -> + Answer when is_list(Answer) or is_binary(Answer) -> case trim(Answer) of "y" -> yes; "n" -> no; @@ -60,7 +60,7 @@ read_password(Prompt, Opts) -> format("~s", [listify(Prompt)]), ?GET_INTERNAL_OPT(user_pid, Opts) ! {self(), user_password}, receive - Answer when is_list(Answer) -> + Answer when is_list(Answer) or is_binary(Answer) -> case trim(Answer) of "" -> read_password(Prompt, Opts); |