summaryrefslogtreecommitdiff
path: root/src/mochiweb/mochiweb_util.erl
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/mochiweb_util.erl
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/mochiweb_util.erl')
-rw-r--r--src/mochiweb/mochiweb_util.erl21
1 files changed, 3 insertions, 18 deletions
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(),