aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-11-30 15:24:21 +0100
committerPatrik Nyblom <[email protected]>2010-11-30 16:37:42 +0100
commitc9d45aa9f32a76a4b08edd1d6010764d9ab02f9b (patch)
treeb134b55b129a4860f5a87217f372651292bc6ceb /lib/kernel
parente5bd984329db28dc0e34cf9dd7f6a1cc97c3192c (diff)
downloadotp-c9d45aa9f32a76a4b08edd1d6010764d9ab02f9b.tar.gz
otp-c9d45aa9f32a76a4b08edd1d6010764d9ab02f9b.tar.bz2
otp-c9d45aa9f32a76a4b08edd1d6010764d9ab02f9b.zip
Treat soft links on Windows correctly in file_name_SUITE
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/file_name_SUITE.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl
index c96621d036..3faae93bea 100644
--- a/lib/kernel/test/file_name_SUITE.erl
+++ b/lib/kernel/test/file_name_SUITE.erl
@@ -193,7 +193,7 @@ check_normal(Mod) ->
?line Syms = [ {S,Targ,list_to_binary(get_data(Targ,normal_dir()))}
|| {T,S,Targ} <- normal_dir(), T =:= symlink ],
?line [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
- ?line [ {ok, Targ} = Mod:read_link(SymL) || {SymL,Targ,_} <- Syms ],
+ ?line [ {ok, Targ} = fixlink(Mod:read_link(SymL)) || {SymL,Targ,_} <- Syms ],
?line chk_cre_dir(Mod,[{directory,"temp_dir",normal_dir()}]),
?line {ok,BeginAt} = Mod:get_cwd(),
?line true = is_list(BeginAt),
@@ -279,7 +279,7 @@ check_icky(Mod) ->
?line Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,icky_dir()))}
|| {T,S,Targ} <- icky_dir(), T =:= symlink ],
?line [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
- ?line [ {ok, Targ} = Mod:read_link(SymL) || {SymL,Targ,_} <- Syms ],
+ ?line [ {ok, Targ} = fixlink(Mod:read_link(SymL)) || {SymL,Targ,_} <- Syms ],
?line chk_cre_dir(Mod,[{directory,"���_dir",icky_dir()}]),
?line {ok,BeginAt} = Mod:get_cwd(),
?line true = is_list(BeginAt),
@@ -416,7 +416,7 @@ check_very_icky(Mod) ->
?line Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,very_icky_dir()))}
|| {T,S,Targ} <- very_icky_dir(), T =:= symlink ],
?line [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
- ?line [ {ok, Targ} = Mod:read_link(SymL) || {SymL,Targ,_} <- Syms ],
+ ?line [ {ok, Targ} = fixlink(Mod:read_link(SymL)) || {SymL,Targ,_} <- Syms ],
?line chk_cre_dir(Mod,[{directory,[1088,1079,1091]++"_dir",very_icky_dir()}]),
?line {ok,BeginAt} = Mod:get_cwd(),
?line true = is_list(BeginAt),
@@ -691,6 +691,11 @@ treat_icky(Bin) ->
Bin
end.
+fixlink({ok,Link}) ->
+ {ok,filename:basename(Link)};
+fixlink(X) ->
+ X.
+
procentify(<<>>) ->
<<>>;
procentify(<<X:8,Rst/binary>>) when X > 127 ->