diff options
author | Hans Bolinder <[email protected]> | 2018-09-18 11:57:10 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-09-18 11:57:10 +0200 |
commit | 41e4dcf4993756390e340e25e2724c11bdab337e (patch) | |
tree | 7974cde0b9a469cba55400c4d0a8d9806a49369a /lib | |
parent | d33ae93faf86804499477a14382902f9da4f2004 (diff) | |
parent | 2d04d2bdf95c3a5f143ed2a5b9295fbf197b9b0b (diff) | |
download | otp-41e4dcf4993756390e340e25e2724c11bdab337e.tar.gz otp-41e4dcf4993756390e340e25e2724c11bdab337e.tar.bz2 otp-41e4dcf4993756390e340e25e2724c11bdab337e.zip |
Merge branch 'hasse/stdlib/binary_in_format/OTP-15304' into maint
* hasse/stdlib/binary_in_format/OTP-15304:
stdlib: Allow lists with binaries in the Format argument
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/src/io_lib_format.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/stdlib/src/io_lib_format.erl b/lib/stdlib/src/io_lib_format.erl index e247b00a04..ab9031573b 100644 --- a/lib/stdlib/src/io_lib_format.erl +++ b/lib/stdlib/src/io_lib_format.erl @@ -246,7 +246,8 @@ count_small([#{control_char := $W}|Cs], #{w := W} = Cnts) -> count_small(Cs, Cnts#{w := W + 1}); count_small([#{control_char := $s}|Cs], #{w := W} = Cnts) -> count_small(Cs, Cnts#{w := W + 1}); -count_small([S|Cs], #{other := Other} = Cnts) when is_list(S) -> +count_small([S|Cs], #{other := Other} = Cnts) when is_list(S); + is_binary(S) -> count_small(Cs, Cnts#{other := Other + string:length(S)}); count_small([C|Cs], #{other := Other} = Cnts) when is_integer(C) -> count_small(Cs, Cnts#{other := Other + 1}); |