From d8fa3de932d97db3a93520ac30f60045e8a9cef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 26 May 2014 15:15:33 +0200 Subject: Teach code:del_path/1 to ignore superfluous slashes The following sequence will NOT leave the code path unchanged: code:add_path("/some/app/"), . . . code:del_path("/some/app/") The reason is that code:add_path/1 will normalize the path name (removing the trailing slash), while code:del_path/1 does not normalize the path before searching for it in the code path. --- lib/kernel/src/code_server.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/kernel/src') diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl index fc7ac08699..f891cb61c4 100644 --- a/lib/kernel/src/code_server.erl +++ b/lib/kernel/src/code_server.erl @@ -988,7 +988,7 @@ try_archive_subdirs(_Archive, Base, []) -> %% the complete directory name. %% del_path(Name0,Path,NameDb) -> - case catch to_list(Name0)of + case catch filename:join([to_list(Name0)]) of {'EXIT',_} -> {{error,bad_name},Path}; Name -> -- cgit v1.2.3