From 6df9a6ab332d698e4b3f3f81e18385d7c522aeba Mon Sep 17 00:00:00 2001 From: Badlop Date: Sat, 20 Feb 2010 19:31:36 +0100 Subject: [PATCH] Use alternative of file:read_line/1 to not require R13B02 --- src/ejabberd_config.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index 2b508acee..383bb574b 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -191,7 +191,7 @@ describe_config_problem(Filename, Reason, LineNumber) -> get_config_lines(Filename, TargetNumber, PreContext, PostContext) -> {ok, Fd} = file:open(Filename, [read]), LNumbers = lists:seq(TargetNumber-PreContext, TargetNumber+PostContext), - NextL = file:read_line(Fd), + NextL = io:get_line(Fd, no_prompt), R = get_config_lines2(Fd, NextL, 1, LNumbers, []), file:close(Fd), R. @@ -200,8 +200,8 @@ get_config_lines2(_Fd, eof, _CurrLine, _LNumbers, R) -> lists:reverse(R); get_config_lines2(_Fd, _NewLine, _CurrLine, [], R) -> lists:reverse(R); -get_config_lines2(Fd, {ok, Data}, CurrLine, [NextWanted | LNumbers], R) -> - NextL = file:read_line(Fd), +get_config_lines2(Fd, Data, CurrLine, [NextWanted | LNumbers], R) when is_list(Data) -> + NextL = io:get_line(Fd, no_prompt), if CurrLine >= NextWanted -> Line2 = [integer_to_list(CurrLine), ": " | Data],