aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-09-18 12:01:49 +0200
committerHans Bolinder <[email protected]>2018-09-18 12:01:49 +0200
commit716d9c2256ddbba2417fd39053a891b870c43472 (patch)
tree2ca954bbb7058083bcec3d7aae423f0fac461218 /lib
parentcf605966712d125a78957631043d228227c91698 (diff)
parent41e4dcf4993756390e340e25e2724c11bdab337e (diff)
downloadotp-716d9c2256ddbba2417fd39053a891b870c43472.tar.gz
otp-716d9c2256ddbba2417fd39053a891b870c43472.tar.bz2
otp-716d9c2256ddbba2417fd39053a891b870c43472.zip
Merge branch 'maint'
* maint: stdlib: Allow lists with binaries in the Format argument
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/src/io_lib_format.erl3
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});