From 380af78843891b0994f625d392fad674c1bc4fef Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Mon, 4 Jun 2018 13:58:02 +0200 Subject: stdlib: Make pP insert no line breaks with field width zero See also https://bugs.erlang.org/browse/ERL-607. A zero field width used to insert line breaks "everywhere", but with this patch no line breaks are inserted. --- lib/stdlib/src/io_lib_pretty.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/stdlib/src/io_lib_pretty.erl') diff --git a/lib/stdlib/src/io_lib_pretty.erl b/lib/stdlib/src/io_lib_pretty.erl index 3d5a979b3e..dca1b37ef3 100644 --- a/lib/stdlib/src/io_lib_pretty.erl +++ b/lib/stdlib/src/io_lib_pretty.erl @@ -131,6 +131,8 @@ print(Term, Col, Ll, D, M0, T, RecDefFun, Enc, Str) when is_tuple(Term); %% use Len as CHAR_MAX if M0 = -1 M = max_cs(M0, Len), if + Ll =:= 0 -> + write(If); Len < Ll - Col, Len =< M -> %% write the whole thing on a single line when there is room write(If); -- cgit v1.2.3