aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Arendt <[email protected]>2014-10-01 10:32:42 +0200
committerMarcus Arendt <[email protected]>2014-10-01 10:32:42 +0200
commit86ae7ccc44b38137c504a46b619ffad935d74b99 (patch)
treed1dbb0f51c128ed33fad8b18f147e1ef0b008605
parent40bfc04288f623d7dbabc90f0c93c6baef997ba7 (diff)
parenta476a844554d25fd704888f63a302659aa5dc67a (diff)
downloadotp-86ae7ccc44b38137c504a46b619ffad935d74b99.tar.gz
otp-86ae7ccc44b38137c504a46b619ffad935d74b99.tar.bz2
otp-86ae7ccc44b38137c504a46b619ffad935d74b99.zip
Merge branch 'capflam/filelib_wildcard_fix' into maint
* capflam/filelib_wildcard_fix: Fix filelib:wildcard/2 when 'Cwd' ends with a dot
-rw-r--r--lib/stdlib/src/filelib.erl2
-rw-r--r--lib/stdlib/test/filelib_SUITE.erl1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/stdlib/src/filelib.erl b/lib/stdlib/src/filelib.erl
index 9efbe8da20..daae1fd2d2 100644
--- a/lib/stdlib/src/filelib.erl
+++ b/lib/stdlib/src/filelib.erl
@@ -371,7 +371,7 @@ compile_wildcard(Pattern, Cwd0) ->
[Root|Rest] = filename:split(Pattern),
case filename:pathtype(Root) of
relative ->
- Cwd = filename:join([Cwd0]),
+ Cwd = prepare_base(Cwd0),
compile_wildcard_2([Root|Rest], {cwd,Cwd});
_ ->
compile_wildcard_2(Rest, {root,0,Root})
diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl
index 040ae1effc..bd313390b3 100644
--- a/lib/stdlib/test/filelib_SUITE.erl
+++ b/lib/stdlib/test/filelib_SUITE.erl
@@ -88,6 +88,7 @@ wildcard_two(Config) when is_list(Config) ->
?line ok = file:make_dir(Dir),
?line do_wildcard_1(Dir, fun(Wc) -> io:format("~p~n",[{Wc,Dir, X = filelib:wildcard(Wc, Dir)}]),X end),
?line do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, Dir++"/") end),
+ ?line do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, Dir++"/.") end),
case os:type() of
{win32,_} ->
ok;