Navigation Menu

Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 19, 2017
1 parent 1bbb671 commit f17d906
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/ctx.c
Expand Up @@ -1600,14 +1600,15 @@ 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';
}

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++) {
Expand All @@ -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);
Expand Down

0 comments on commit f17d906

Please sign in to comment.