summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-06-04 19:06:25 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-06-04 19:06:25 +0000
commita3ea1255d671340668a0151c689e27dc49597fe3 (patch)
tree987989494409d783d7cef6b585d688a343fa0571 /src
parent03800e092938c950a394e23e4dbb57b7a723778d (diff)
Use linebreaks between rows for view results with a negative count value, same as for a positive value.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@663345 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_httpd.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index d22ea2b1..81217a74 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -762,14 +762,14 @@ make_view_fold_fun(Req, QueryArgs, TotalViewCount, ReduceCountFun) ->
Resp2 = start_json_response(Req, 200),
Offset2 = TotalViewCount - Offset -
lists:min([TotalViewCount - Offset, - AccCount]),
- JsonBegin = io_lib:format("{\"total_rows\":~w,\"offset\":~w,\"rows\":[",
+ JsonBegin = io_lib:format("{\"total_rows\":~w,\"offset\":~w,\"rows\":[\r\n",
[TotalViewCount, Offset2]),
Resp2:write_chunk(lists:flatten(JsonBegin)),
JsonObj = {obj, [{id, DocId}, {key, Key}, {value, Value}]},
{ok, {AccCount + 1, 0, Resp2, [cjson:encode(JsonObj) | AccRevRows]}};
{_, AccCount, _, Resp} ->
JsonObj = {obj, [{id, DocId}, {key, Key}, {value, Value}]},
- {ok, {AccCount + 1, 0, Resp, [cjson:encode(JsonObj), "," | AccRevRows]}}
+ {ok, {AccCount + 1, 0, Resp, [cjson:encode(JsonObj), ",\r\n" | AccRevRows]}}
end
end,