X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Foptions.c;h=c48939e5a6ef056c472649cffb588e8692d2eae7;hp=7e738d734042219b7d166536b3012b1bf5926dcd;hb=e43979e7020ea9d05a3c0a2af444f292eacb6c53;hpb=a79adf1383e61bd5fe6d90518a4e34b4e3e592bc diff --git a/src/helper/options.c b/src/helper/options.c index 7e738d7340..c48939e5a6 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -24,18 +24,12 @@ #include "config.h" #endif -#include "replacements.h" - -#include "types.h" -#include "command.h" #include "configuration.h" #include "log.h" +// @todo the inclusion of server.h here is a layering violation #include "server.h" -#include -#include #include -#include static int help_flag, version_flag; @@ -54,7 +48,7 @@ static struct option long_options[] = int configuration_output_handler(struct command_context_s *context, const char* line) { - LOG_USER_N(line); + LOG_USER_N("%s", line); return ERROR_OK; } @@ -97,16 +91,20 @@ int add_default_dirs(void) *strrchr(strExePath, '\\')=0; strcat(strExePath, "/../lib/"PACKAGE); for(p=strExePath; *p; p++) { - if(*p == '\\') + if (*p == '\\') *p = '/'; } add_script_search_dir(strExePath); } #else - /* Add dir for openocd supplied scripts last so that user can over - ride those scripts if desired. */ - add_script_search_dir(PKGDATADIR); - add_script_search_dir(PKGLIBDIR); + /* + * The directory containing OpenOCD-supplied scripts should be + * 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"). + add_script_search_dir(PKGDATADIR "/site"); + add_script_search_dir(PKGDATADIR "/scripts"); #endif return ERROR_OK; }