aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/systools_make.erl
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <[email protected]>2014-03-19 15:19:19 +0100
committerJean-Sébastien Pédron <[email protected]>2014-03-24 17:37:29 +0100
commitf149194f227fd593757ff2c750b82b62f9a6e8aa (patch)
treef1ac375ec02f2673cf5e03e1b40a9ecaa3503b85 /lib/sasl/src/systools_make.erl
parent8acc644e162bad52f7ab81c76c0cad15628e4f3d (diff)
downloadotp-f149194f227fd593757ff2c750b82b62f9a6e8aa.tar.gz
otp-f149194f227fd593757ff2c750b82b62f9a6e8aa.tar.bz2
otp-f149194f227fd593757ff2c750b82b62f9a6e8aa.zip
sasl: Fix crash in systools_make:format_error/1
The crash occurred when systools:make_script/2 raises the 'duplicate_modules' error. Depending on the 'silent' option, systools_make:format_error/1 is called to either format and display an error message, or return a tuple containing the error properties. When displaying a 'duplicate_modules' error message, format_error/1 receives a list of applications providing the same module(s): [ {{Mod,App1,_}, {Mod,App2,_}}, ... ] However, before this fix, format_error/1 expected the following structure, leading to a 'function_clause' exception: [ {{Mod,_,App1,_,_}, {Mod,_,App2,_,_}}, ... ] The crash never occurred with the 'silent' option, because the error and its properties are returned as is to the caller.
Diffstat (limited to 'lib/sasl/src/systools_make.erl')
-rw-r--r--lib/sasl/src/systools_make.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl
index bab88552f9..daa65e32b7 100644
--- a/lib/sasl/src/systools_make.erl
+++ b/lib/sasl/src/systools_make.erl
@@ -2218,7 +2218,7 @@ format_error({undefined_applications,Apps}) ->
io_lib:format("Undefined applications: ~p~n",[Apps]);
format_error({duplicate_modules,Dups}) ->
io_lib:format("Duplicated modules: ~n~ts",
- [map(fun({{Mod,_,App1,_,_},{Mod,_,App2,_,_}}) ->
+ [map(fun({{Mod,App1,_},{Mod,App2,_}}) ->
io_lib:format("\t~w specified in ~w and ~w~n",
[Mod,App1,App2])
end, Dups)]);