[Groonga-commit] groonga/groonga [master] output return code in put_delimiter()

Back to archive index

null+****@clear***** null+****@clear*****
2010年 6月 19日 (土) 18:00:04 JST


Daijiro MORI	2010-06-19 09:00:04 +0000 (Sat, 19 Jun 2010)

  New Revision: 9c338cb97e8d36ca3b13e92b69380e2955949740

  Log:
    output return code in put_delimiter()

  Modified files:
    lib/output.c

  Modified: lib/output.c (+11 -15)
===================================================================
--- lib/output.c    2010-06-19 07:33:44 +0000 (e1a561a)
+++ lib/output.c    2010-06-19 09:00:04 +0000 (b80624c)
@@ -40,7 +40,11 @@ put_delimiter(grn_ctx *ctx)
   case GRN_CONTENT_XML:
     break;
   case GRN_CONTENT_TSV:
-    if (DEPTH > 1) { GRN_TEXT_PUTC(ctx, outbuf, '\t'); }
+    if (DEPTH == 1) {
+      GRN_TEXT_PUTC(ctx, outbuf, '\n');
+    } else if (DEPTH > 1) {
+      GRN_TEXT_PUTC(ctx, outbuf, '\t');
+    }
   case GRN_CONTENT_NONE:
     break;
   }
@@ -79,13 +83,9 @@ grn_output_array_close(grn_ctx *ctx)
     GRN_TEXT_PUTC(ctx, outbuf, ']');
     break;
   case GRN_CONTENT_TSV:
-    if (DEPTH > 1) {
-      if (DEPTH == 2) {
-        GRN_TEXT_PUTC(ctx, outbuf, '\n');
-      } else {
-        if (CURR_LEVEL >= 2) { GRN_TEXT_PUTC(ctx, outbuf, '\t'); }
-        GRN_TEXT_PUTC(ctx, outbuf, ']');
-      }
+    if (DEPTH > 2) {
+      if (CURR_LEVEL >= 2) { GRN_TEXT_PUTC(ctx, outbuf, '\t'); }
+      GRN_TEXT_PUTC(ctx, outbuf, ']');
     }
     break;
   case GRN_CONTENT_XML:
@@ -132,13 +132,9 @@ grn_output_map_close(grn_ctx *ctx)
     GRN_TEXT_PUTS(ctx, outbuf, "}");
     break;
   case GRN_CONTENT_TSV:
-    if (DEPTH) {
-      if (DEPTH == 1) {
-        GRN_TEXT_PUTC(ctx, outbuf, '\n');
-      } else {
-        if (CURR_LEVEL >= 2) { GRN_TEXT_PUTC(ctx, outbuf, '\t'); }
-        GRN_TEXT_PUTC(ctx, outbuf, '}');
-      }
+    if (DEPTH > 2) {
+      if (CURR_LEVEL >= 2) { GRN_TEXT_PUTC(ctx, outbuf, '\t'); }
+      GRN_TEXT_PUTC(ctx, outbuf, '}');
     }
     break;
   case GRN_CONTENT_XML:




Groonga-commit メーリングリストの案内
Back to archive index