summaryrefslogtreecommitdiff
path: root/src/mochiweb
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-08-21 11:54:24 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-08-21 11:54:24 +0000
commit678512dcabec2a54071ed63ed786c4c0c3f1d647 (patch)
tree78ddd07d4f504e11b10b91ad18ca454ce5e5d034 /src/mochiweb
parentc41f80bcce84f06f9d46eecb7d012e1f0cd12dcf (diff)
Back out Mochiweb patch from r659636 to support older Erlang versions, as those are no longer supported by CouchDB anyway.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@806513 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/mochiweb')
-rw-r--r--src/mochiweb/mochifmt.erl2
-rw-r--r--src/mochiweb/mochiweb_headers.erl2
-rw-r--r--src/mochiweb/mochiweb_html.erl4
-rw-r--r--src/mochiweb/mochiweb_multipart.erl2
-rw-r--r--src/mochiweb/mochiweb_util.erl21
5 files changed, 8 insertions, 23 deletions
diff --git a/src/mochiweb/mochifmt.erl b/src/mochiweb/mochifmt.erl
index 696559d2..da0a133a 100644
--- a/src/mochiweb/mochifmt.erl
+++ b/src/mochiweb/mochifmt.erl
@@ -297,7 +297,7 @@ convert2(Arg, #conversion{ctype=oct}) ->
convert2(Arg, #conversion{ctype=upper_hex}) ->
erlang:integer_to_list(Arg, 16);
convert2(Arg, #conversion{ctype=hex}) ->
- mochiweb_util:to_lower(erlang:integer_to_list(Arg, 16));
+ string:to_lower(erlang:integer_to_list(Arg, 16));
convert2(Arg, #conversion{ctype=char}) when Arg < 16#80 ->
[Arg];
convert2(Arg, #conversion{ctype=char}) ->
diff --git a/src/mochiweb/mochiweb_headers.erl b/src/mochiweb/mochiweb_headers.erl
index b29ff311..6fcec7c3 100644
--- a/src/mochiweb/mochiweb_headers.erl
+++ b/src/mochiweb/mochiweb_headers.erl
@@ -168,7 +168,7 @@ merge(_, V1, V0) ->
V0 ++ ", " ++ V1.
normalize(K) when is_list(K) ->
- mochiweb_util:to_lower(K);
+ string:to_lower(K);
normalize(K) when is_atom(K) ->
normalize(atom_to_list(K));
normalize(K) when is_binary(K) ->
diff --git a/src/mochiweb/mochiweb_html.erl b/src/mochiweb/mochiweb_html.erl
index 05ea6382..0e030c13 100644
--- a/src/mochiweb/mochiweb_html.erl
+++ b/src/mochiweb/mochiweb_html.erl
@@ -330,7 +330,7 @@ tokens(B, S=#decoder{offset=O}, Acc) ->
end.
parse_flag({start_tag, B, _, false}) ->
- case mochiweb_util:to_lower(binary_to_list(B)) of
+ case string:to_lower(binary_to_list(B)) of
"script" ->
script;
"textarea" ->
@@ -551,7 +551,7 @@ norm({Tag, Attrs}) ->
norm(Tag) when is_binary(Tag) ->
Tag;
norm(Tag) ->
- list_to_binary(mochiweb_util:to_lower(Tag)).
+ list_to_binary(string:to_lower(Tag)).
test_destack() ->
{<<"a">>, [], []} =
diff --git a/src/mochiweb/mochiweb_multipart.erl b/src/mochiweb/mochiweb_multipart.erl
index 7d42be52..9eb4badd 100644
--- a/src/mochiweb/mochiweb_multipart.erl
+++ b/src/mochiweb/mochiweb_multipart.erl
@@ -103,7 +103,7 @@ parse_headers(Binary, Acc) ->
split_header(Line) ->
{Name, [$: | Value]} = lists:splitwith(fun (C) -> C =/= $: end,
binary_to_list(Line)),
- {mochiweb_util:to_lower(string:strip(Name)),
+ {string:to_lower(string:strip(Name)),
mochiweb_util:parse_header(Value)}.
read_chunk(Req, Length) when Length > 0 ->
diff --git a/src/mochiweb/mochiweb_util.erl b/src/mochiweb/mochiweb_util.erl
index 93c03431..7bf18d15 100644
--- a/src/mochiweb/mochiweb_util.erl
+++ b/src/mochiweb/mochiweb_util.erl
@@ -12,7 +12,6 @@
-export([shell_quote/1, cmd/1, cmd_string/1, cmd_port/2]).
-export([record_to_proplist/2, record_to_proplist/3]).
-export([safe_relative_path/1, partition/2]).
--export([to_lower/1]).
-export([test/0]).
-define(PERCENT, 37). % $\%
@@ -239,7 +238,7 @@ urlsplit_scheme(Url) ->
urlsplit_scheme([], Acc) ->
{"", lists:reverse(Acc)};
urlsplit_scheme(":" ++ Rest, Acc) ->
- {to_lower(lists:reverse(Acc)), Rest};
+ {string:to_lower(lists:reverse(Acc)), Rest};
urlsplit_scheme([C | Rest], Acc) ->
urlsplit_scheme(Rest, [C | Acc]).
@@ -391,11 +390,11 @@ parse_header(String) ->
%% Skip anything with no value
Acc;
{Name, [$\= | Value]} ->
- [{to_lower(string:strip(Name)),
+ [{string:to_lower(string:strip(Name)),
unquote_header(string:strip(Value))} | Acc]
end
end,
- {to_lower(Type),
+ {string:to_lower(Type),
lists:foldr(F, [], Parts)}.
unquote_header("\"" ++ Rest) ->
@@ -438,20 +437,6 @@ shell_quote([C | Rest], Acc) when C =:= $\" orelse C =:= $\` orelse
shell_quote([C | Rest], Acc) ->
shell_quote(Rest, [C | Acc]).
-to_lower_char(C) when is_integer(C), C >= $A, C =< $Z ->
- C + 32;
-to_lower_char(C) when is_integer(C), C >= 16#C1, C =< 16#D6 ->
- C + 32;
-to_lower_char(C) when is_integer(C), C >= 16#D8, C =< 16#DE ->
- C + 32;
-to_lower_char(C) ->
- C.
-
-to_lower(S) when is_list(S) ->
- [to_lower_char(C) || C <- S];
-to_lower(C) when is_integer(C) ->
- to_lower_char(C).
-
test() ->
test_join(),
test_quote_plus(),