Skip to content

Commit

Permalink
fix bug for can't find erlang.html on erts-5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jixiuf committed Sep 20, 2012
1 parent 6d528a8 commit 9b5a497
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/otp_doc.erl
Expand Up @@ -217,8 +217,18 @@ lines(Line,_,Dir) ->
case string:tokens(Line, "<> \"") of
["TD", "A", "HREF=", "../"++Href, M|_] ->
case filename:basename(Href,".html") of
"index" -> ok;
M -> e_set({file,M}, filename:join([Dir,Href]))
"index" -> ok;
"erlang"->
%%treat erlang module special,because there are two links
%% HREF="../erts-5.9/doc/html/erlang.html" this is the real one
%% HREF="../lib/kernel-2.15/doc/html/erlang.html" there is nothing here
case ets:lookup(otp_doc,{file,"erlang"}) of
[]->
e_set({file,M}, filename:join([Dir,Href]));
[{{file,"erlang"}, ErlangPath}]->
e_set({file,M}, ErlangPath)
end;
M -> e_set({file,M}, filename:join([Dir,Href]))
end;
_ -> ok
end.
Expand Down

0 comments on commit 9b5a497

Please sign in to comment.