[Groonga-commit] groonga/groonga at f17d906 [master] Simplify

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Thu Oct 19 15:23:33 JST 2017


Kouhei Sutou	2017-10-19 15:23:33 +0900 (Thu, 19 Oct 2017)

  New Revision: f17d9068891c025cf30cd343e9244f527d5da485
  https://github.com/groonga/groonga/commit/f17d9068891c025cf30cd343e9244f527d5da485

  Message:
    Simplify

  Modified files:
    lib/ctx.c

  Modified: lib/ctx.c (+5 -9)
===================================================================
--- lib/ctx.c    2017-10-19 14:52:25 +0900 (a431a5f63)
+++ lib/ctx.c    2017-10-19 15:23:33 +0900 (5b1bbe4bd)
@@ -1600,7 +1600,7 @@ exception_filter(EXCEPTION_POINTERS *info)
     const char *base_dir;
 
     if (SymGetSearchPath(process, search_path, sizeof(search_path))) {
-      grn_strncat(search_path, sizeof(search_path), ";", 1);
+      grn_strcat(search_path, sizeof(search_path), ";");
     } else {
       search_path[0] = '\0';
     }
@@ -1608,6 +1608,7 @@ exception_filter(EXCEPTION_POINTERS *info)
     base_dir = grn_windows_base_dir();
     {
       char *current, *end;
+      const char *pdb_dir = "\\lib\\pdb";
       current = search_path + strlen(search_path);
       end = current + sizeof(search_path) - 1;
       for (; *base_dir && current < end; base_dir++, current++) {
@@ -1617,16 +1618,11 @@ exception_filter(EXCEPTION_POINTERS *info)
           *current = *base_dir;
         }
       }
-      {
-        const char *pdb_dir = "\\lib\\pdb";
-        size_t pdb_dir_length;
-        pdb_dir_length = strlen(pdb_dir);
-        if ((current + pdb_dir_length + 1) < end) {
-          grn_strncat(current, pdb_dir_length + 1, pdb_dir, pdb_dir_length);
-          current += pdb_dir_length;
-        }
+      if (current == end) {
+        current--;
       }
       *current = '\0';
+      grn_strcat(search_path, sizeof(search_path), pdb_dir);
     }
 
     SymSetSearchPath(process, search_path);
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171019/4abe9cd0/attachment-0001.htm 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る