Skip to content

Commit

Permalink
Merge branch 'env-var-for-scheme-dir'
Browse files Browse the repository at this point in the history
  • Loading branch information
subins2000 committed Sep 19, 2020
2 parents cccafe2 + 4583e67 commit cd85661
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions varnam.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ varnam_get_suggestions_file (varnam *handle)
}

static const char* symbolsFileSearchPath[] = {
"/app/share/varnam/vst",
"/usr/local/share/varnam/vst",
"/usr/share/varnam/vst",
"schemes"
Expand All @@ -224,9 +223,15 @@ find_symbols_file_directory()
return strbuf_to_s(varnam_symbols_dir);
}

for (i = 0; i < ARRAY_SIZE (symbolsFileSearchPath); i++) {
if (is_directory (symbolsFileSearchPath[i]))
return symbolsFileSearchPath[i];
char *env_symbols_dir = getenv("VARNAM_SYMBOLS_DIR");

if (env_symbols_dir != NULL) {
return env_symbols_dir;
} else {
for (i = 0; i < ARRAY_SIZE (symbolsFileSearchPath); i++) {
if (is_directory (symbolsFileSearchPath[i]))
return symbolsFileSearchPath[i];
}
}

return NULL;
Expand Down

0 comments on commit cd85661

Please sign in to comment.