diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2013-07-30 22:56:57 +0200 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-12-22 20:24:26 +0000 |
commit | 537b75aa45e03bb2adab1c4fc033a294a26401f9 (patch) | |
tree | f1927919fd0c732c384f1fc4a9b3675b464e2683 | |
parent | 619b8383e9cf31159c16825206a5da7154451494 (diff) | |
download | riscv-openocd-537b75aa45e03bb2adab1c4fc033a294a26401f9.zip riscv-openocd-537b75aa45e03bb2adab1c4fc033a294a26401f9.tar.gz riscv-openocd-537b75aa45e03bb2adab1c4fc033a294a26401f9.tar.bz2 |
Add %APPDATA%\OpenOCD to script search path on win
Change-Id: I01e9715fe064f3ff41e41a59a4764d6474f82183
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1797
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
-rw-r--r-- | src/helper/options.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/helper/options.c b/src/helper/options.c index 00f1dbe..a378131 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) { |