X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Finterpreter.c;h=8dbb790922c2ab5c6086b910803ece20cc47b890;hp=abf7b0938762a1c32681571570d49fa87dca45fe;hb=381f9a2e8aa1697e2af3c2bcad962dfcfe7348d7;hpb=0689e3dd6752f45f493eceb3edf040fbc7849846 diff --git a/src/helper/interpreter.c b/src/helper/interpreter.c index abf7b09387..8dbb790922 100644 --- a/src/helper/interpreter.c +++ b/src/helper/interpreter.c @@ -221,17 +221,7 @@ int handle_script_command(struct command_context_s *cmd_ctx, char *cmd, char **a if (argc != 1) return ERROR_COMMAND_SYNTAX_ERROR; - script_file = open_file_from_path(cmd_ctx, args[0], "r"); - - if (!script_file) - { - command_print(cmd_ctx, "couldn't open script file %s", args[0]); - return ERROR_OK; - } - command_run_file(cmd_ctx, script_file, cmd_ctx->mode); - - fclose(script_file); - - return ERROR_OK; + /* Run a tcl script file */ + return command_run_linef(cmd_ctx, "source [find {%s}]", args[0]); }