X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fhelper%2Foptions.c;h=573026a6e39f7396ce5e2b21b683810587e3575a;hb=1dd5277ba3eb8c5938832b41c2bf6cb5bf19146e;hp=874196eabc5b82384a7c7c4caf7004617ca99cae;hpb=ccf59123b72b01149063d5864ef61077786c033e;p=openocd.git diff --git a/src/helper/options.c b/src/helper/options.c index 874196eabc..573026a6e3 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -26,7 +26,7 @@ #include "configuration.h" // @todo the inclusion of server.h here is a layering violation -#include "server.h" +#include #include @@ -101,7 +101,22 @@ static void add_default_dirs(void) * listed last in the built-in search order, so the user can * override these scripts with site-specific customizations. */ - /// @todo Implement @c add_script_search_dir("${HOME}/.openocd"). + + const char *home = getenv("HOME"); + + if (home) + { + char *path; + + path = alloc_printf("%s/.openocd", home); + + if (path) + { + add_script_search_dir(path); + free(path); + } + } + add_script_search_dir(PKGDATADIR "/site"); add_script_search_dir(PKGDATADIR "/scripts"); #endif