From 381f9a2e8aa1697e2af3c2bcad962dfcfe7348d7 Mon Sep 17 00:00:00 2001 From: oharboe Date: Fri, 11 Jul 2008 09:06:36 +0000 Subject: .cfg files are now executed as Jim Tcl. Commands that terminate script w/error message. git-svn-id: svn://svn.berlios.de/openocd/trunk@790 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/helper/interpreter.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/helper/interpreter.c') diff --git a/src/helper/interpreter.c b/src/helper/interpreter.c index 186d992e..8dbb7909 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 (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]); } -- cgit v1.2.3