From: Andreas Fritiofson Date: Tue, 30 Jul 2013 20:56:57 +0000 (+0200) Subject: Add %APPDATA%\OpenOCD to script search path on win X-Git-Tag: v0.8.0-rc1~148 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=537b75aa45e03bb2adab1c4fc033a294a26401f9;p=openocd 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 --- 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) {