From df921fef405ba0b04d7a919a187174e97dcfc4a5 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 30 Oct 2012 13:05:30 +0100 Subject: [PATCH] Show binaries as strings in WebAdmin; handle tab characters. --- src/web/ejabberd_web_admin.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 106c036f5..65c524796 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -1070,15 +1070,17 @@ pretty_sentence([Char | A], R) -> pretty_sentence(A, [Char | R]). pretty_binary([$>, $> | A], "") -> - {A, ">>" ++ "<<"}; + {A, "\"\""}; pretty_binary([$>, $> | A], R) -> - {A, ">>" ++ io_lib:format("~p", [lists:reverse(R)]) ++ "<<"}; + {A, io_lib:format("~p", [lists:reverse(R)])}; pretty_binary([$, | A], R) -> pretty_binary(A, R); pretty_binary([32 | A], R) -> pretty_binary(A, R); pretty_binary([$\n | A], R) -> pretty_binary(A, R); +pretty_binary([$\t | A], R) -> + pretty_binary(A, R); pretty_binary([Digit1, Digit2, Other | A], R) when (Other == $>) or (Other == $,) -> Integer = list_to_integer([Digit1, Digit2]), pretty_binary([Other | A], [Integer | R]);