aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Rascão <[email protected]>2014-06-27 00:08:07 +0100
committerLuis Rascão <[email protected]>2014-06-27 00:08:07 +0100
commitab50e4e5121c2c29b8a49916f8ac89e42e37a978 (patch)
treeedc225a369d44e5125e1b2d842b87713ee9d0a30
parentc9e36ab16034bb7fe71f772df6bba22070976bbf (diff)
downloadotp-ab50e4e5121c2c29b8a49916f8ac89e42e37a978.tar.gz
otp-ab50e4e5121c2c29b8a49916f8ac89e42e37a978.tar.bz2
otp-ab50e4e5121c2c29b8a49916f8ac89e42e37a978.zip
fix escript archive symlinked across drives
real_path method used while prim loading archive files was not taking into account the fact that windows directory symlinks can be across different drives (eg. c:\tmp\test is a symlink to j:\tmp\test). when performing a path split the drive precedes the symlink, but that has be rewritten also since it's different. This issue never arises in Unix since obviously there are no drives
-rw-r--r--erts/preloaded/src/erl_prim_loader.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/erts/preloaded/src/erl_prim_loader.erl b/erts/preloaded/src/erl_prim_loader.erl
index 578913b633..dfd6151b69 100644
--- a/erts/preloaded/src/erl_prim_loader.erl
+++ b/erts/preloaded/src/erl_prim_loader.erl
@@ -1487,7 +1487,12 @@ real_path(Name,[Path|Paths],Acc,Links) ->
[""|_] = LinkPaths ->
real_path(Name,LinkPaths++Paths,[],[ThisFile|Links]);
LinkPaths ->
- real_path(Name,LinkPaths++Paths,Acc,[ThisFile|Links])
+ case erlang:system_info(os_type) of
+ {win32, _} ->
+ real_path(Name,LinkPaths++Paths,[],[ThisFile|Links]);
+ _ ->
+ real_path(Name,LinkPaths++Paths,Acc,[ThisFile|Links])
+ end
end;
_ ->
real_path(Name,Paths,This,Links)