[Groonga-commit] groonga/groonga [master] Don't output error for empty input.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 13日 (火) 09:25:28 JST


Daijiro MORI	2010-07-13 00:25:28 +0000 (Tue, 13 Jul 2010)

  New Revision: 43813069ceece746f3a165d6231633ea9f6a5434

  Log:
    Don't output error for empty input.

  Modified files:
    lib/ctx.c

  Modified: lib/ctx.c (+4 -2)
===================================================================
--- lib/ctx.c    2010-07-12 13:20:51 +0000 (bb18e9d)
+++ lib/ctx.c    2010-07-13 00:25:28 +0000 (184e7f4)
@@ -951,8 +951,10 @@ grn_ctx_qe_exec(grn_ctx *ctx, const char *str, uint32_t str_len)
   } else {
     GRN_BULK_REWIND(&buf);
     grn_text_unesc_tok(ctx, &buf, str, str + str_len, &tok_type);
-    ERR(GRN_INVALID_ARGUMENT, "invalid command name: %.*s",
-        GRN_TEXT_LEN(&buf), GRN_TEXT_VALUE(&buf));
+    if (GRN_TEXT_LEN(&buf)) {
+      ERR(GRN_INVALID_ARGUMENT, "invalid command name: %.*s",
+          GRN_TEXT_LEN(&buf), GRN_TEXT_VALUE(&buf));
+    }
   }
   GRN_OBJ_FIN(ctx, &buf);
   return expr;




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