1 Star 0 Fork 21

shafeipaozi/erlang

forked from src-openEuler/erlang 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
otp-0006-Add-extra-search-directory.patch 975 Bytes
一键复制 编辑 原始数据 按行查看 历史
shafeipaozi 提交于 2024-02-17 21:48 . update
From: Peter Lemenkov <[email protected]>
Date: Wed, 2 Aug 2017 16:12:19 +0300
Subject: [PATCH] Add extra search directory
Signed-off-by: Peter Lemenkov <[email protected]>
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index af8531271f..66050d6cdb 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -79,11 +79,17 @@ init(Ref, Parent, [Root,Mode]) ->
IPath =
case Mode of
interactive ->
- LibDir = filename:append(Root, "lib"),
- {ok,Dirs} = erl_prim_loader:list_dir(LibDir),
- Paths = make_path(LibDir, Dirs),
+ F = fun(R) ->
+ LD = filename:append(R, "lib"),
+ case erl_prim_loader:list_dir(LD) of
+ error -> [];
+ {ok, D} -> make_path(LD, D)
+ end
+ end,
+ Paths = F(Root),
+ SharedPaths = F("/usr/share/erlang"),
UserLibPaths = get_user_lib_dirs(),
- ["."] ++ UserLibPaths ++ Paths;
+ ["."] ++ UserLibPaths ++ Paths ++ SharedPaths;
_ ->
[]
end,
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shafeipaozi/erlang.git
[email protected]:shafeipaozi/erlang.git
shafeipaozi
erlang
erlang
master

搜索帮助