diff options
author | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-20 08:32:40 +0000 |
---|---|---|
committer | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-20 08:32:40 +0000 |
commit | a5ab45af4e644869a542e9ed92699fde803e543c (patch) | |
tree | 2bb411ef15bee16010070947b27a124ae8a535d0 | |
parent | 6057fc8ab8a0e4395b1675250d03e199976186eb (diff) | |
download | openocd_libswd-a5ab45af4e644869a542e9ed92699fde803e543c.tar.gz openocd_libswd-a5ab45af4e644869a542e9ed92699fde803e543c.tar.bz2 openocd_libswd-a5ab45af4e644869a542e9ed92699fde803e543c.tar.xz openocd_libswd-a5ab45af4e644869a542e9ed92699fde803e543c.zip |
- fix bug when using full paths to config files. Thanks Ted Roth
git-svn-id: svn://svn.berlios.de/openocd/trunk@314 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/helper/configuration.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/helper/configuration.c b/src/helper/configuration.c index 2cb08338..2fbed08b 100644 --- a/src/helper/configuration.c +++ b/src/helper/configuration.c @@ -81,9 +81,6 @@ int parse_cmdline_args(struct command_context_s *cmd_ctx, int argc, char *argv[] int c; char command_buffer[128]; - /* Always search relative to current working dir first. */ - add_script_search_dir("."); - while (1) { /* getopt_long stores the option index here. */ @@ -150,6 +147,11 @@ FILE *open_file_from_path (command_context_t *cmd_ctx, char *file, char *mode) char *dir; char full_path[1024]; + /* Check absolute and relative to current working dir first. + * This keeps full_path reporting belowing working. */ + snprintf(full_path, 1024, "%s", file); + fp = fopen(full_path, mode); + while (!fp) { dir = *search_dirs++; |