[Groonga-commit] groonga/groonga [master] [groonga] don't show input file information for stdin.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 1月 6日 (金) 16:01:45 JST


Kouhei Sutou	2012-01-06 16:01:45 +0900 (Fri, 06 Jan 2012)

  New Revision: 6e7cea84d0a1ae1eebdd700104b3c4dddfdd2100

  Log:
    [groonga] don't show input file information for stdin.

  Modified files:
    src/groonga.c

  Modified: src/groonga.c (+2 -7)
===================================================================
--- src/groonga.c    2012-01-06 15:44:59 +0900 (c49ebc4)
+++ src/groonga.c    2012-01-06 16:01:45 +0900 (c8e18ab)
@@ -546,14 +546,9 @@ print_return_code(grn_ctx *ctx, grn_rc rc, grn_obj *head, grn_obj *body, grn_obj
         grn_text_esc(ctx, head, ctx->errfile, strlen(ctx->errfile));
         GRN_TEXT_PUTC(ctx, head, ',');
         grn_text_itoa(ctx, head, ctx->errline);
-        if ((command = GRN_CTX_USER_DATA(ctx)->ptr)) {
+        if (input_path && (command = GRN_CTX_USER_DATA(ctx)->ptr)) {
           GRN_TEXT_PUTC(ctx, head, ',');
-          if (input_path) {
-            grn_text_esc(ctx, head, input_path, strlen(input_path));
-          } else {
-            const char *stdin_name = "(stdin)";
-            grn_text_esc(ctx, head, stdin_name, strlen(stdin_name));
-          }
+          grn_text_esc(ctx, head, input_path, strlen(input_path));
           GRN_TEXT_PUTC(ctx, head, ',');
           grn_text_itoa(ctx, head, number_of_lines);
           GRN_TEXT_PUTC(ctx, head, ',');




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