24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00

Fix function clause on filelib:wildcard/1

This commit is contained in:
Evgeniy Khramtsov 2017-11-24 12:10:03 +03:00
parent a57c694f21
commit e31f6409a6

View File

@ -278,7 +278,7 @@ get_certfiles_from_config_options(State) ->
undefined -> undefined ->
[]; [];
Paths -> Paths ->
lists:flatmap(fun filelib:wildcard/1, Paths) lists:flatmap(fun wildcard/1, Paths)
end, end,
Local = lists:flatmap( Local = lists:flatmap(
fun(OptHost) -> fun(OptHost) ->
@ -532,7 +532,7 @@ certs_dir() ->
-spec clean_dir(file:filename_all()) -> ok. -spec clean_dir(file:filename_all()) -> ok.
clean_dir(Dir) -> clean_dir(Dir) ->
?DEBUG("Cleaning directory ~s", [Dir]), ?DEBUG("Cleaning directory ~s", [Dir]),
Files = filelib:wildcard(filename:join(Dir, "*")), Files = wildcard(filename:join(Dir, "*")),
lists:foreach( lists:foreach(
fun(Path) -> fun(Path) ->
case filelib:is_file(Path) of case filelib:is_file(Path) of
@ -545,7 +545,7 @@ clean_dir(Dir) ->
-spec check_ca_dir() -> ok. -spec check_ca_dir() -> ok.
check_ca_dir() -> 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", Hint = "configuring 'ca_path' option might help",
case file:list_dir(ca_dir()) of case file:list_dir(ca_dir()) of
@ -728,3 +728,8 @@ start_fs() ->
[Reason]), [Reason]),
false false
end. end.
wildcard(Path) when is_binary(Path) ->
wildcard(binary_to_list(Path));
wildcard(Path) ->
filelib:wildcard(Path).