[Groonga-commit] groonga/groonga at 0bc4424 [master] Update the rest of the input string even on error

Back to archive index

susumu.yata null+****@clear*****
Thu Jan 15 11:54:20 JST 2015


susumu.yata	2015-01-15 11:54:20 +0900 (Thu, 15 Jan 2015)

  New Revision: 0bc4424de78ddc7b7f3abacf57692df474176ce6
  https://github.com/groonga/groonga/commit/0bc4424de78ddc7b7f3abacf57692df474176ce6

  Message:
    Update the rest of the input string even on error

  Modified files:
    lib/dat.cpp

  Modified: lib/dat.cpp (+6 -0)
===================================================================
--- lib/dat.cpp    2015-01-15 11:45:27 +0900 (7e9d8b4)
+++ lib/dat.cpp    2015-01-15 11:54:20 +0900 (4a3db12)
@@ -678,6 +678,9 @@ grn_dat_scan(grn_ctx *ctx, grn_dat *dat, const char *str,
 {
   if (!grn_dat_open_trie_if_needed(ctx, dat) || !str ||
       !(dat->obj.header.flags & GRN_OBJ_KEY_VAR_SIZE) || !scan_hits) {
+    if (str_rest) {
+      *str_rest = str;
+    }
     return -1;
   }
 
@@ -783,6 +786,9 @@ grn_dat_scan(grn_ctx *ctx, grn_dat *dat, const char *str,
   } catch (const grn::dat::Exception &ex) {
     ERR(grn_dat_translate_error_code(ex.code()),
         "grn::dat::lcp_search failed");
+    if (str_rest) {
+      *str_rest = str;
+    }
     return -1;
   }
   return static_cast<int>(num_scan_hits);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index