diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-06-14 18:45:49 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-06-14 18:45:49 +0000 |
commit | cd39ebe7d12d999324ff2cc9842567b34dc4d4c7 (patch) | |
tree | 00bde7d855ba9cd07c2e5d0463dfd32c4f0badcc /src/couchdb/couch_js.c | |
parent | 88fcbd2cdd14fedab900fbf3af3deb5fe15f4390 (diff) |
merge list-iterator branch to trunk. changes JavaScript _list API
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@784601 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_js.c')
-rw-r--r-- | src/couchdb/couch_js.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/couchdb/couch_js.c b/src/couchdb/couch_js.c index 045e6c7f..d95b9db0 100644 --- a/src/couchdb/couch_js.c +++ b/src/couchdb/couch_js.c @@ -247,13 +247,13 @@ GC(JSContext *context, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { static JSBool Print(JSContext *context, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - uintN i, n; + uintN i; size_t cl, bl; JSString *str; jschar *chars; char *bytes; - for (i = n = 0; i < argc; i++) { + for (i = 0; i < argc; i++) { str = JS_ValueToString(context, argv[i]); if (!str) return JS_FALSE; @@ -270,9 +270,8 @@ Print(JSContext *context, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { fprintf(stdout, "%s%s", i ? " " : "", bytes); JS_free(context, bytes); } - n++; - if (n) - fputc('\n', stdout); + + fputc('\n', stdout); fflush(stdout); return JS_TRUE; } |