aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-05-21 11:26:19 +0200
committerLukas Larsson <[email protected]>2018-05-30 11:51:46 +0200
commit7786776b6dc68e3837fa2a384185e2a05f7f6e46 (patch)
treea22f600b8074829156aa901e7270c1aba879134b
parent9962a0e9bc96055627e75485c1cc01b3a412894b (diff)
downloadotp-7786776b6dc68e3837fa2a384185e2a05f7f6e46.tar.gz
otp-7786776b6dc68e3837fa2a384185e2a05f7f6e46.tar.bz2
otp-7786776b6dc68e3837fa2a384185e2a05f7f6e46.zip
stdlib: Fix io:put_chars/2 error
Before this fix an error in io:put_chars/2 would signal a fault in io:put_chars/3 because of the way that raise is used and there is no such function.
-rw-r--r--lib/stdlib/src/io.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/stdlib/src/io.erl b/lib/stdlib/src/io.erl
index f510f61e9f..5d5773c80c 100644
--- a/lib/stdlib/src/io.erl
+++ b/lib/stdlib/src/io.erl
@@ -86,7 +86,16 @@ put_chars(Chars) ->
CharData :: unicode:chardata().
put_chars(Io, Chars) ->
- o_request(Io, {put_chars,unicode,Chars}, put_chars).
+ put_chars(Io, unicode, Chars).
+
+%% This function is here to make the erlang:raise in o_request actually raise to
+%% a valid function.
+-spec put_chars(IoDevice, Encoding, CharData) -> 'ok' when
+ IoDevice :: device(),
+ Encoding :: unicode,
+ CharData :: unicode:chardata().
+put_chars(Io, Encoding, Chars) ->
+ o_request(Io, {put_chars,Encoding,Chars}, put_chars).
-spec nl() -> 'ok'.