Allow to pass \n in argument to ejabberdctl

This commit is contained in:
Paweł Chmielowski 2016-02-12 23:37:48 +01:00
parent 06f2237132
commit 47a67c7320
2 changed files with 6 additions and 2 deletions

View File

@ -163,7 +163,11 @@ shell_escape()
{
local RES=()
for i in "$@"; do
printf '%q ' "$i"
if test -z "$i"; then
printf '"" '
else
printf '"%q" ' "$i" | sed 's/\\\\n/\n/g;s/\\\\t/\t/g;s/\\\\r/\r/g'
fi
done
}

View File

@ -324,7 +324,7 @@ format_args(Args, ArgsFormat) ->
format_arg(Arg, integer) ->
format_arg2(Arg, "~d");
format_arg(Arg, binary) ->
list_to_binary(format_arg(Arg, string));
unicode:characters_to_binary(Arg, utf8);
format_arg("", string) ->
"";
format_arg(Arg, string) ->