From 440299656f201fb02aba70efbe91c7cf10dd62e3 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 11 Dec 2009 20:08:06 +0000 Subject: [PATCH] Print command's reply and newline only when there's something to print. SVN Revision: 2807 --- src/ejabberd_ctl.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index 9e398f8c3..d8238bad7 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -197,8 +197,12 @@ process(["help" | Mode]) -> process(Args) -> AccessCommands = get_accesscommands(), {String, Code} = process2(Args, AccessCommands), - io:format(String), - io:format("\n"), + case String of + [] -> ok; + _ -> + io:format(String), + io:format("\n") + end, Code. %% @spec (Args::[string()], AccessCommands) -> {String::string(), Code::integer()}