From 537b75aa45e03bb2adab1c4fc033a294a26401f9 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Tue, 30 Jul 2013 22:56:57 +0200 Subject: [PATCH] Add %APPDATA%\OpenOCD to script search path on win Change-Id: I01e9715fe064f3ff41e41a59a4764d6474f82183 Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/1797 Tested-by: jenkins Reviewed-by: Jens Bauer Reviewed-by: Spencer Oliver --- src/helper/options.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/helper/options.c b/src/helper/options.c index 00f1dbed..a378131a 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -113,6 +113,17 @@ static void add_default_dirs(void) free(path); } } +#ifdef _WIN32 + const char *appdata = getenv("APPDATA"); + + if (appdata) { + path = alloc_printf("%s/OpenOCD", appdata); + if (path) { + add_script_search_dir(path); + free(path); + } + } +#endif path = alloc_printf("%s%s%s", run_prefix, PKGDATADIR, "/site"); if (path) { -- 2.39.5