- Replace 'for(' with 'for ('.
[fw/openocd] / src / helper / options.c
index 801bd11b2606708ffb981afeef3682596582afe0..23491d3f5b2c075cd932ffff2fafca990e06260e 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "configuration.h"
 #include "log.h"
+// @todo the inclusion of server.h here is a layering violation
 #include "server.h"
 
 #include <getopt.h>
@@ -89,17 +90,21 @@ int add_default_dirs(void)
                GetModuleFileName (NULL, strExePath, MAX_PATH);
                *strrchr(strExePath, '\\')=0;
                strcat(strExePath, "/../lib/"PACKAGE);
-               for(p=strExePath; *p; p++) {
-                       if(*p == '\\')
+               for (p=strExePath; *p; 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;
 }