summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Sawan <ssawan@virtualhold.com>2017-07-17 16:29:18 -0400
committerSam Sawan <ssawan@virtualhold.com>2017-07-17 16:29:18 -0400
commitf62b7cb32e93fa1f2b30c649e25f555c1b216c75 (patch)
tree12b02524f8f4894fe0a8973634e4dce85495cc1a
parentd09aaed77d9bd82063fbeda2347e083b752f6e2c (diff)
[#149002995] fix flipped variables
-rw-r--r--src/rebar_prv_edoc.erl11
1 files changed, 6 insertions, 5 deletions
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)].