diff options
author | Hans Bolinder <[email protected]> | 2018-06-04 13:58:02 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-06-07 08:43:20 +0200 |
commit | 380af78843891b0994f625d392fad674c1bc4fef (patch) | |
tree | 89667fe524d1343727adbe9af929b38ce748a650 /lib/stdlib/src | |
parent | 9ae2044073e6433030ce30756658b103ce67c3c1 (diff) | |
download | otp-380af78843891b0994f625d392fad674c1bc4fef.tar.gz otp-380af78843891b0994f625d392fad674c1bc4fef.tar.bz2 otp-380af78843891b0994f625d392fad674c1bc4fef.zip |
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.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/io_lib_pretty.erl | 2 |
1 files changed, 2 insertions, 0 deletions
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); |