You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/02/13 17:43:31 UTC

[29/50] lager commit: updated refs/heads/import-master to da4419e

Remove the workaround for the bug when printing empty binaries in W mode

The fix for this was merged in R16 somewhere, so this workaround is no
longer needed, and fixes the EQC test from spotting the divergent
behaviour with io_lib.

See also: http://erlang.org/pipermail/erlang-patches/2012-September/003034.html


Project: http://git-wip-us.apache.org/repos/asf/couchdb-lager/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-lager/commit/4c7bd96d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-lager/tree/4c7bd96d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-lager/diff/4c7bd96d

Branch: refs/heads/import-master
Commit: 4c7bd96d626c10fb26fee3b5add4593e404d3295
Parents: d18019b
Author: Andrew Thompson <an...@hijacked.us>
Authored: Fri Jan 24 00:09:26 2014 -0500
Committer: Andrew Thompson <an...@hijacked.us>
Committed: Fri Jan 24 00:09:26 2014 -0500

----------------------------------------------------------------------
 src/lager_trunc_io.erl | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/4c7bd96d/src/lager_trunc_io.erl
----------------------------------------------------------------------
diff --git a/src/lager_trunc_io.erl b/src/lager_trunc_io.erl
index 43b3d24..a2f2d6b 100644
--- a/src/lager_trunc_io.erl
+++ b/src/lager_trunc_io.erl
@@ -127,13 +127,10 @@ print(Atom, _Max, #print_options{force_strings=NoQuote}) when is_atom(Atom) ->
     end,
     {R, length(R)};
 
-print(Bin, _Max, O = #print_options{depth=1}) when is_binary(Bin) ->
-    case O#print_options.lists_as_strings of
-        true when Bin == <<>>  ->
-            {"<<>>", 4};
-        _ ->
-            {"<<...>>", 7}
-    end;
+print(<<>>, _Max, #print_options{depth=1}) ->
+    {"<<>>", 4};
+print(Bin, _Max, #print_options{depth=1}) when is_binary(Bin) ->
+    {"<<...>>", 7};
 print(<<>>, _Max, Options) ->
     case Options#print_options.force_strings of
         true ->
@@ -766,7 +763,7 @@ depth_limit_test() ->
 
     %% I don't even know...
     ?assertEqual("<<>>", lists:flatten(format("~P", [<<>>, 1], 50))),
-    ?assertEqual("<<...>>", lists:flatten(format("~W", [<<>>, 1], 50))),
+    ?assertEqual("<<>>", lists:flatten(format("~W", [<<>>, 1], 50))),
 
     ?assertEqual("{abc,<<\"abc\\\"\">>}", lists:flatten(format("~P", [{abc,<<"abc\"">>}, 4], 50))),