aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_lib.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/edoc/src/edoc_lib.erl')
-rw-r--r--lib/edoc/src/edoc_lib.erl18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/edoc/src/edoc_lib.erl b/lib/edoc/src/edoc_lib.erl
index 6c698e83ef..7fd8358add 100644
--- a/lib/edoc/src/edoc_lib.erl
+++ b/lib/edoc/src/edoc_lib.erl
@@ -15,7 +15,7 @@
%% USA
%%
%% @copyright 2001-2003 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @see edoc
%% @end
%% =====================================================================
@@ -403,8 +403,13 @@ escape_uri([C | Cs]) ->
escape_uri([]) ->
[].
-escape_byte(C) ->
- "%" ++ hex_octet(C).
+escape_byte(C) when C >= 0, C =< 255 ->
+ [$%, hex_digit(C bsr 4), hex_digit(C band 15)].
+
+hex_digit(N) when N >= 0, N =< 9 ->
+ N + $0;
+hex_digit(N) when N > 9, N =< 15 ->
+ N + $a - 10.
% utf8([C | Cs]) when C > 16#7f ->
% [((C band 16#c0) bsr 6) + 16#c0, C band 16#3f ++ 16#80 | utf8(Cs)];
@@ -413,13 +418,6 @@ escape_byte(C) ->
% utf8([]) ->
% [].
-hex_octet(N) when N =< 9 ->
- [$0 + N];
-hex_octet(N) when N > 15 ->
- hex_octet(N bsr 4) ++ hex_octet(N band 15);
-hex_octet(N) ->
- [N - 10 + $a].
-
%% Please note that URI are *not* file names. Don't use the stdlib
%% 'filename' module for operations on (any parts of) URI.