=== modified file 'reshd.erl' --- reshd.erl 2007-03-12 02:59:18 +0000 +++ reshd.erl 2007-03-12 02:59:44 +0000 @@ -229,6 +229,9 @@ R = (catch clienthandler_loop(idle, Reshd, Server, ClientSocket)), exit(Reshd, kill). +iolist_flatten(IoList) -> + binary_to_list(iolist_to_binary(IoList)). + clienthandler_loop(State, Reshd, Server, ClientSocket) -> receive {tcp, _Socket, Input} -> @@ -332,13 +335,13 @@ {'EXIT', Reason} -> ""; Txt -> Txt end, - NWText = nl_native_to_network(lists:flatten(Text)), + NWText = nl_native_to_network(iolist_flatten(Text)), gen_tcp:send(ClientSocket, NWText), io_reply(From, ReplyAs, ok), {ok, State}; {put_chars, Text} -> - NWText = nl_native_to_network(lists:flatten(Text)), + NWText = nl_native_to_network(iolist_flatten(Text)), gen_tcp:send(ClientSocket, Text), io_reply(From, ReplyAs, ok), {ok, State}; @@ -398,7 +401,7 @@ Term -> io_lib:write(Term) end, - NWPromptText = nl_native_to_network(lists:flatten(PromptText)), + NWPromptText = nl_native_to_network(iolist_flatten(PromptText)), gen_tcp:send(ClientSocket, NWPromptText). %% Convert network newline (cr,lf) to native (\n) @@ -449,8 +452,8 @@ fmt(FmtStr, Args) -> case catch io_lib:format(FmtStr, Args) of {'EXIT', Reason} -> - lists:flatten(io_lib:format("Badly formatted text: ~p, ~p~n", + iolist_flatten(io_lib:format("Badly formatted text: ~p, ~p~n", [FmtStr, Args])); DeepText -> - lists:flatten(DeepText) + iolist_flatten(DeepText) end.