diff --git a/src/urilib.app.src b/src/urilib.app.src index 59b3bad..5d0bd49 100644 --- a/src/urilib.app.src +++ b/src/urilib.app.src @@ -1,6 +1,6 @@ {application, urilib, [ {description, "A RFC-3986 URI Library for parsing and building URIs"}, - {vsn,"0.2.0"}, + {vsn,"0.3.0"}, {licenses, ["BSD"]}, {links, [{"Github", "https://github.com/gmr/urilib"}]}, {maintainers, ["Gavin M. Roy"]}, diff --git a/src/urilib.erl b/src/urilib.erl index b579ad9..755cc93 100644 --- a/src/urilib.erl +++ b/src/urilib.erl @@ -323,11 +323,11 @@ url_maybe_add_fragment(Value, URL) -> hex_to_upper(Value) -> hex_to_upper(Value, []). hex_to_upper([], Accum) -> - Accum; + lists:reverse(Accum); hex_to_upper([$%, B1, B2|T], Accum) -> - hex_to_upper(T, lists:append(Accum, [$%, to_upper(B1), to_upper(B2)])); + hex_to_upper(T, [to_upper(B2), to_upper(B1), $% | Accum]); hex_to_upper([H|T], Accum) -> - hex_to_upper(T, lists:append(Accum, [H])). + hex_to_upper(T, [H | Accum]). -spec to_upper(char()) -> char().