This is an automated email from the ASF dual-hosted git repository. jan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 3c3546c7cc98831185e979a3aee63188a3a29fb2 Author: Jan Lehnardt <[email protected]> AuthorDate: Sun Jun 17 17:17:37 2018 +0200 string:trim() compat for couch_util:trim() --- src/couch/src/couch_util.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/couch/src/couch_util.erl b/src/couch/src/couch_util.erl index 72ee73f..936b562 100644 --- a/src/couch/src/couch_util.erl +++ b/src/couch/src/couch_util.erl @@ -338,6 +338,9 @@ is_whitespace(_Else) -> false. % removes leading and trailing whitespace from a string +trim(String) when is_binary(String) -> + % mirror string:trim() behaviour of returning a binary when a binary is passed in + ?l2b(trim(?b2l(String))); trim(String) -> String2 = lists:dropwhile(fun is_whitespace/1, String), lists:reverse(lists:dropwhile(fun is_whitespace/1, lists:reverse(String2))).
