aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-07-21 16:50:47 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-07-21 16:50:47 +0200
commit7775d7318deae8aee766b68f5512bf06b11fe598 (patch)
tree10b57eb37747db8cad4d11fda3a490d70c1166aa
parent7c10598da79e28c9b802029d94269cbebba2f21e (diff)
parenta0686ba8dec9c57f455fda4ee14e1f9954b8b434 (diff)
downloadotp-7775d7318deae8aee766b68f5512bf06b11fe598.tar.gz
otp-7775d7318deae8aee766b68f5512bf06b11fe598.tar.bz2
otp-7775d7318deae8aee766b68f5512bf06b11fe598.zip
Merge branch 'imrivera/kernel/fix-code_server-crash/ERL-194/PR-1128/OTP-13765' into maint
* imrivera/kernel/fix-code_server-crash/ERL-194/PR-1128/OTP-13765: Fix code_server crash when adding some code paths ERL-194
-rw-r--r--lib/kernel/src/code_server.erl20
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)];