From f62b7cb32e93fa1f2b30c649e25f555c1b216c75 Mon Sep 17 00:00:00 2001 From: Sam Sawan Date: Mon, 17 Jul 2017 16:29:18 -0400 Subject: [#149002995] fix flipped variables --- src/rebar_prv_edoc.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_edoc.erl b/src/rebar_prv_edoc.erl index 6e58ad5..d663b0c 100644 --- a/src/rebar_prv_edoc.erl +++ b/src/rebar_prv_edoc.erl @@ -84,8 +84,9 @@ format_error(Reason) -> has_configured_paths(EdocOpts) -> proplists:get_value(dir, EdocOpts) =/= undefined. -add_to_paths(Opts, Path) -> - case proplists:get_value(doc_path, Opts) of - undefined -> [{doc_path, [Path]} | Opts]; - Paths -> lists:keyreplace(doc_path, 1, Opts, {doc_path, [Path | Paths]}) - end. +add_to_paths([], Path) -> + [{doc_path, [Path]}]; +add_to_paths([{doc_path, Paths}|T], Path) -> + [{doc_path, [Path | Paths]} | T]; +add_to_paths([H|T], Path) -> + [H | add_to_paths(T, Path)]. -- cgit v1.1