Skip to content

Commit 14cddf3

Browse files
committed
Also handle charlist returns from stdio
Closes #12687.
1 parent 92eee10 commit 14cddf3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/iex/lib/iex/broker.ex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ defmodule IEx.Broker do
8585
yes?(IO.gets(:stdio, interrupt))
8686
end
8787

88-
defp yes?(string) do
89-
is_binary(string) and String.trim(string) in ["", "y", "Y", "yes", "YES", "Yes"]
90-
end
88+
defp yes?(string) when is_binary(string),
89+
do: String.trim(string) in ["", "y", "Y", "yes", "YES", "Yes"]
90+
91+
defp yes?(charlist) when is_list(charlist),
92+
do: yes?(List.to_string(charlist))
93+
94+
defp yes?(_), do: false
9195

9296
@doc """
9397
Client requests a takeover.

0 commit comments

Comments
 (0)