aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-03-10 10:54:32 +0100
committerZandra Hird <[email protected]>2015-03-10 10:54:32 +0100
commit2d7459ccf971e34e223b3d691057725fbf761f32 (patch)
treec03f411a0ae13a43165746c7d1746e4fb5f15e89 /lib
parent4037296294670e7a9bb2a3c1cdbd0236cbc15807 (diff)
parentf0f727d1d22282786048d8024e60bb2f24e7202e (diff)
downloadotp-2d7459ccf971e34e223b3d691057725fbf761f32.tar.gz
otp-2d7459ccf971e34e223b3d691057725fbf761f32.tar.bz2
otp-2d7459ccf971e34e223b3d691057725fbf761f32.zip
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/src/ets.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/stdlib/src/ets.erl b/lib/stdlib/src/ets.erl
index 26b0393b35..09c8924650 100644
--- a/lib/stdlib/src/ets.erl
+++ b/lib/stdlib/src/ets.erl
@@ -1625,13 +1625,18 @@ choice(Height, Width, P, Mode, Tab, Key, Turn, Opos) ->
end.
get_line(P, Default) ->
- case io:get_line(P) of
+ case line_string(io:get_line(P)) of
"\n" ->
Default;
L ->
L
end.
+%% If the standard input is set to binary mode
+%% convert it to a list so we can properly match.
+line_string(Binary) when is_binary(Binary) -> unicode:characters_to_list(Binary);
+line_string(Other) -> Other.
+
nonl(S) -> string:strip(S, right, $\n).
print_number(Tab, Key, Num) ->