File otp_src_18.3.3-edlin_expand-expand-function-name-non-loaded-modules.patch of Package erlang

diff -Ndurp otp_src_18.3.3/lib/stdlib/src/edlin_expand.erl otp_src_18.3.3-edlin_expand-expand-function-name-non-loaded-modules/lib/stdlib/src/edlin_expand.erl
--- otp_src_18.3.3/lib/stdlib/src/edlin_expand.erl	2016-05-03 11:11:12.000000000 +0300
+++ otp_src_18.3.3-edlin_expand-expand-function-name-non-loaded-modules/lib/stdlib/src/edlin_expand.erl	2016-06-02 14:26:08.357133513 +0300
@@ -51,15 +51,19 @@ expand_function_name(ModStr, FuncPrefix)
 	{ok, Mod} ->
 	    case erlang:module_loaded(Mod) of
 		true ->
-		    L = Mod:module_info(),
-		    case lists:keyfind(exports, 1, L) of
-			{_, Exports} ->
-			    match(FuncPrefix, Exports, "(");
-			_ ->
-			    {no, [], []}
+		    case Mod:module_info(exports) of
+			[_|_] = Exports -> match(FuncPrefix, Exports, "(");
+			_ -> {no, [], []}
 		    end;
 		false ->
-		    {no, [], []}
+		    case code:which(Mod) of
+			non_existing -> {no, [], []};
+			Path ->
+			    case beam_lib:chunks(Path, [exports]) of
+				{ok, {Mod, [{exports, [_|_] = Exports}]}} -> match(FuncPrefix, Exports, "(");
+				_ -> {no, [], []}
+			    end
+		    end
 	    end;
 	error ->
 	    {no, [], []}
openSUSE Build Service is sponsored by