aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/src/compiler/diameter_dict_util.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/diameter/src/compiler/diameter_dict_util.erl b/lib/diameter/src/compiler/diameter_dict_util.erl
index 6098656f03..36a6efa294 100644
--- a/lib/diameter/src/compiler/diameter_dict_util.erl
+++ b/lib/diameter/src/compiler/diameter_dict_util.erl
@@ -630,13 +630,28 @@ reset(K, Dict, Opts) ->
opt({inherits = Key, "-"}, Dict) ->
dict:erase(Key, Dict);
+
opt({inherits = Key, Mod}, Dict) ->
- dict:append(Key, [0, {word, 0, Mod}], Dict);
+ case lists:splitwith(fun(C) -> C /= $/ end, Mod) of
+ {Mod, ""} ->
+ dict:append(Key, [0, {word, 0, Mod}], Dict);
+ {From, [$/|To]} ->
+ dict:store(Key,
+ [reinherit(From, To, M) || M <- find(Key, Dict)],
+ Dict)
+ end;
+
opt({Key, Val}, Dict) ->
dict:store(Key, [[0, {word, 0, Val}]], Dict);
+
opt(_, Dict) ->
Dict.
+reinherit(From, To, [L, {word, _, From} = T | Avps]) ->
+ [L, setelement(3, T, To) | Avps];
+reinherit(_, _, T) ->
+ T.
+
%% ===========================================================================
%% pass1/1
%%