X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Fconfiguration.c;h=d72556060bb738935299539481d6b2b67b27276f;hp=abbcbfcb0bc9f5ae43d927fe1a25bbafa13a80f7;hb=3a3fc300141d9e0e6b71729d7fd604aa28447116;hpb=0a749feb8e05d41b22a75e5545233b3e400463f8 diff --git a/src/helper/configuration.c b/src/helper/configuration.c index abbcbfcb0b..d72556060b 100644 --- a/src/helper/configuration.c +++ b/src/helper/configuration.c @@ -54,8 +54,14 @@ void add_config_file_name (const char *cfg) config_file_names[num_config_files] = NULL; } -FILE *open_file_from_path (command_context_t *cmd_ctx, char *file, char *mode) +FILE *open_file_from_path (char *file, char *mode) { + if (mode[0]!='r') + { + return fopen(file, mode); + } else + { + FILE *fp = NULL; char **search_dirs = script_search_dirs; char *dir; @@ -78,9 +84,10 @@ FILE *open_file_from_path (command_context_t *cmd_ctx, char *file, char *mode) } if (fp) - command_print(cmd_ctx, "opened %s", full_path); + DEBUG("opened %s", full_path); return fp; + } } int parse_config_file(struct command_context_s *cmd_ctx)