diff options
author | Peter Andersson <[email protected]> | 2016-09-14 13:29:42 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2016-09-14 13:29:42 +0200 |
commit | 356338ad69008558cc2be1bd57fe6caa10c04fe1 (patch) | |
tree | b5bca72332a6aa78148e9db84e54958b002d34d6 | |
parent | b2eebe8f1737629e5e04e81fffda26fc90fb2efe (diff) | |
parent | c376e2a0fd5cc77ce6be99279a601e680b86a1b4 (diff) | |
download | otp-356338ad69008558cc2be1bd57fe6caa10c04fe1.tar.gz otp-356338ad69008558cc2be1bd57fe6caa10c04fe1.tar.bz2 otp-356338ad69008558cc2be1bd57fe6caa10c04fe1.zip |
Merge branch 'peppe/kernel/invalid_priv_dir/ERL-195/OTP-13758' into maint
* peppe/kernel/invalid_priv_dir/ERL-195/OTP-13758:
Fix incorrect priv_dir when adding app's ebin directory to path
OTP-13758
-rw-r--r-- | lib/kernel/src/code_server.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl index 48541ec500..29307bc696 100644 --- a/lib/kernel/src/code_server.erl +++ b/lib/kernel/src/code_server.erl @@ -811,7 +811,13 @@ clear_namedb([], _) -> %% Dir must be a complete pathname (not only a name). insert_dir(Dir, Db) -> Splitted = filename:split(Dir), - Name = get_name_from_splitted(Splitted), + case get_name_from_splitted(Splitted) of + Name when Name /= "ebin", Name /= "." -> + Name; + _ -> + SplittedAbsName = filename:split(absname(Dir)), + Name = get_name_from_splitted(SplittedAbsName) + end, AppDir = filename:join(del_ebin_1(Splitted)), do_insert_name(Name, AppDir, Db). @@ -952,6 +958,10 @@ del_ebin_1([Parent,App,"ebin"]) -> [Archive] end end; +del_ebin_1(Path = [_App,"ebin"]) -> + del_ebin_1(filename:split(absname(filename:join(Path)))); +del_ebin_1(["ebin"]) -> + del_ebin_1(filename:split(absname("ebin"))); del_ebin_1([H|T]) -> [H|del_ebin_1(T)]; del_ebin_1([]) -> |