mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-28 16:34:13 +01:00
Use alternative of file:read_line/1 to not require R13B02
This commit is contained in:
parent
2907446e87
commit
6df9a6ab33
@ -191,7 +191,7 @@ describe_config_problem(Filename, Reason, LineNumber) ->
|
|||||||
get_config_lines(Filename, TargetNumber, PreContext, PostContext) ->
|
get_config_lines(Filename, TargetNumber, PreContext, PostContext) ->
|
||||||
{ok, Fd} = file:open(Filename, [read]),
|
{ok, Fd} = file:open(Filename, [read]),
|
||||||
LNumbers = lists:seq(TargetNumber-PreContext, TargetNumber+PostContext),
|
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, []),
|
R = get_config_lines2(Fd, NextL, 1, LNumbers, []),
|
||||||
file:close(Fd),
|
file:close(Fd),
|
||||||
R.
|
R.
|
||||||
@ -200,8 +200,8 @@ get_config_lines2(_Fd, eof, _CurrLine, _LNumbers, R) ->
|
|||||||
lists:reverse(R);
|
lists:reverse(R);
|
||||||
get_config_lines2(_Fd, _NewLine, _CurrLine, [], R) ->
|
get_config_lines2(_Fd, _NewLine, _CurrLine, [], R) ->
|
||||||
lists:reverse(R);
|
lists:reverse(R);
|
||||||
get_config_lines2(Fd, {ok, Data}, CurrLine, [NextWanted | LNumbers], R) ->
|
get_config_lines2(Fd, Data, CurrLine, [NextWanted | LNumbers], R) when is_list(Data) ->
|
||||||
NextL = file:read_line(Fd),
|
NextL = io:get_line(Fd, no_prompt),
|
||||||
if
|
if
|
||||||
CurrLine >= NextWanted ->
|
CurrLine >= NextWanted ->
|
||||||
Line2 = [integer_to_list(CurrLine), ": " | Data],
|
Line2 = [integer_to_list(CurrLine), ": " | Data],
|
||||||
|
Loading…
Reference in New Issue
Block a user