Skip to content

Commit

Permalink
Fix function clause on filelib:wildcard/1
Browse files Browse the repository at this point in the history
  • Loading branch information
zinid committed Nov 24, 2017
1 parent a57c694 commit e31f640
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ejabberd_pkix.erl
Expand Up @@ -278,7 +278,7 @@ get_certfiles_from_config_options(State) ->
undefined ->
[];
Paths ->
lists:flatmap(fun filelib:wildcard/1, Paths)
lists:flatmap(fun wildcard/1, Paths)
end,
Local = lists:flatmap(
fun(OptHost) ->
Expand Down Expand Up @@ -532,7 +532,7 @@ certs_dir() ->
-spec clean_dir(file:filename_all()) -> ok.
clean_dir(Dir) ->
?DEBUG("Cleaning directory ~s", [Dir]),
Files = filelib:wildcard(filename:join(Dir, "*")),
Files = wildcard(filename:join(Dir, "*")),
lists:foreach(
fun(Path) ->
case filelib:is_file(Path) of
Expand All @@ -545,7 +545,7 @@ clean_dir(Dir) ->

-spec check_ca_dir() -> ok.
check_ca_dir() ->
case filelib:wildcard(filename:join(ca_dir(), "*.0")) of
case wildcard(filename:join(ca_dir(), "*.0")) of
[] ->
Hint = "configuring 'ca_path' option might help",
case file:list_dir(ca_dir()) of
Expand Down Expand Up @@ -728,3 +728,8 @@ start_fs() ->
[Reason]),
false
end.

wildcard(Path) when is_binary(Path) ->
wildcard(binary_to_list(Path));
wildcard(Path) ->
filelib:wildcard(Path).

0 comments on commit e31f640

Please sign in to comment.