diff options
author | Ignacio MartÃnez <[email protected]> | 2016-07-14 12:52:10 +0200 |
---|---|---|
committer | Ignacio MartÃnez <[email protected]> | 2016-07-14 12:52:10 +0200 |
commit | a0686ba8dec9c57f455fda4ee14e1f9954b8b434 (patch) | |
tree | 5d8a763beb26ce1e5c16b8b26de648c508e2b29b /lib/kernel | |
parent | 71f7cfea14a71550100298636d9d229fafd79344 (diff) | |
download | otp-a0686ba8dec9c57f455fda4ee14e1f9954b8b434.tar.gz otp-a0686ba8dec9c57f455fda4ee14e1f9954b8b434.tar.bz2 otp-a0686ba8dec9c57f455fda4ee14e1f9954b8b434.zip |
Fix code_server crash when adding some code paths ERL-194
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/src/code_server.erl | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl index 6174136507..1792f9e908 100644 --- a/lib/kernel/src/code_server.erl +++ b/lib/kernel/src/code_server.erl @@ -933,14 +933,20 @@ del_ebin(Dir) -> filename:join(del_ebin_1(filename:split(Dir))). del_ebin_1([Parent,App,"ebin"]) -> - Ext = archive_extension(), - case filename:basename(Parent, Ext) of - Parent -> - %% Plain directory. + case filename:basename(Parent) of + [] -> + %% Parent is the root directory [Parent,App]; - Archive -> - %% Archive. - [Archive] + _ -> + Ext = archive_extension(), + case filename:basename(Parent, Ext) of + Parent -> + %% Plain directory. + [Parent,App]; + Archive -> + %% Archive. + [Archive] + end end; del_ebin_1([H|T]) -> [H|del_ebin_1(T)]; |