aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tv/src/tv_io_lib.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-03-25 21:19:05 +0100
committerMicael Karlberg <[email protected]>2011-03-25 21:19:05 +0100
commit5396cae69c23d7d8b7bbd0433c3b31144254c7a9 (patch)
treea16e52267f14417155e938ee5f34cc5082efc314 /lib/tv/src/tv_io_lib.erl
parent143cc965e88ea2486c1e6b804f2ae033e870de2d (diff)
parentf0e2f0b91ac4d45a64ddac511e0eba9b6ce01e92 (diff)
downloadotp-5396cae69c23d7d8b7bbd0433c3b31144254c7a9.tar.gz
otp-5396cae69c23d7d8b7bbd0433c3b31144254c7a9.tar.bz2
otp-5396cae69c23d7d8b7bbd0433c3b31144254c7a9.zip
Merge branch 'dev' into bmk/snmp/support_ipv6_transport_address
Diffstat (limited to 'lib/tv/src/tv_io_lib.erl')
-rw-r--r--lib/tv/src/tv_io_lib.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/tv/src/tv_io_lib.erl b/lib/tv/src/tv_io_lib.erl
index f693ff796d..5457575b7d 100644
--- a/lib/tv/src/tv_io_lib.erl
+++ b/lib/tv/src/tv_io_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -52,10 +52,11 @@ write(_Term, 0) -> "...";
write(Term, _D) when is_integer(Term) -> integer_to_list(Term);
write(Term, _D) when is_float(Term) -> tv_io_lib_format:fwrite_g(Term);
write(Atom, _D) when is_atom(Atom) -> write_atom(Atom);
-write(Term, _D) when is_port(Term) -> "#Port";
+write(Term, _D) when is_port(Term) -> lists:flatten(io_lib:write(Term));
write(Term, _D) when is_pid(Term) -> pid_to_list(Term);
-write(Term, _D) when is_reference(Term) -> "#Ref";
-write(Term, _D) when is_binary(Term) -> "#Bin";
+write(Term, _D) when is_reference(Term) -> io_lib:write(Term);
+write(Term, _D) when is_binary(Term), byte_size(Term) > 100 -> "#Bin";
+write(Term, _D) when is_binary(Term) -> "<<\"" ++ binary_to_list(Term) ++ "\">>";
write(Term, _D) when is_bitstring(Term) -> "#Bitstr";
write([], _D) -> "[]";
write({}, _D) -> "{}";