[Groonga-commit] groonga/groonga at 9770689 [master] mecab: use grn_getenv()

Back to archive index

Kouhei Sutou null+****@clear*****
Wed May 13 12:05:25 JST 2015


Kouhei Sutou	2015-05-13 12:05:25 +0900 (Wed, 13 May 2015)

  New Revision: 977068937ebecd7348a12b182f7626e324439fd3
  https://github.com/groonga/groonga/commit/977068937ebecd7348a12b182f7626e324439fd3

  Message:
    mecab: use grn_getenv()

  Modified files:
    plugins/tokenizers/mecab.c

  Modified: plugins/tokenizers/mecab.c (+10 -6)
===================================================================
--- plugins/tokenizers/mecab.c    2015-05-13 12:03:41 +0900 (9207f94)
+++ plugins/tokenizers/mecab.c    2015-05-13 12:05:25 +0900 (899ce0b)
@@ -509,17 +509,21 @@ grn_rc
 GRN_PLUGIN_INIT(grn_ctx *ctx)
 {
   {
-    const char *env;
+    char env[GRN_ENV_BUFFER_SIZE];
 
-    env = getenv("GRN_MECAB_CHUNKED_TOKENIZE_ENABLED");
-    grn_mecab_chunked_tokenize_enabled = (env && strcmp(env, "yes") == 0);
+    grn_getenv("GRN_MECAB_CHUNKED_TOKENIZE_ENABLED",
+               env,
+               GRN_ENV_BUFFER_SIZE);
+    grn_mecab_chunked_tokenize_enabled = (env[0] && strcmp(env, "yes") == 0);
   }
 
   {
-    const char *env;
+    char env[GRN_ENV_BUFFER_SIZE];
 
-    env = getenv("GRN_MECAB_CHUNK_SIZE_THRESHOLD");
-    if (env) {
+    grn_getenv("GRN_MECAB_CHUNK_SIZE_THRESHOLD",
+               env,
+               GRN_ENV_BUFFER_SIZE);
+    if (env[0]) {
       int threshold = -1;
       const char *end;
       const char *rest;
-------------- next part --------------
HTML����������������������������...
다운로드 



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