25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-09-29 14:37:44 +02:00

Show binaries as strings in WebAdmin; handle tab characters.

This commit is contained in:
Badlop 2012-10-30 13:05:30 +01:00
parent 56e7affdfd
commit df921fef40

View File

@ -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]);