summaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-13 21:07:14 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-13 21:07:14 +0000
commit696a20fea495b589305abe6cbd4cbfeb498a33a6 (patch)
tree8da11e3b44d59fd5f4dd2abbe88196fcdd18aeda /src/openocd.c
parent1edd0e68228fb1476e9972251f89c13e91ee44eb (diff)
downloadopenocd+libswd-696a20fea495b589305abe6cbd4cbfeb498a33a6.tar.gz
openocd+libswd-696a20fea495b589305abe6cbd4cbfeb498a33a6.tar.bz2
openocd+libswd-696a20fea495b589305abe6cbd4cbfeb498a33a6.tar.xz
openocd+libswd-696a20fea495b589305abe6cbd4cbfeb498a33a6.zip
- remove unused objcopy from configure.in
- make sure bin2char is built before openocd - add generated startup_tcl.c to clean list - pass startup_tcl directly to Jim_Eval git-svn-id: svn://svn.berlios.de/openocd/trunk@805 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 813c021c..2698b724 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -715,13 +715,9 @@ void add_jim(const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj
}
extern unsigned const char startup_tcl[];
-extern unsigned int startup_tcl_len;
void initJim(void)
-{
- char *script;
- int script_len;
-
+{
Jim_CreateCommand(interp, "openocd", Jim_Command_openocd, NULL, NULL);
Jim_CreateCommand(interp, "openocd_throw", Jim_Command_openocd_throw, NULL, NULL);
Jim_CreateCommand(interp, "find", Jim_Command_find, NULL, NULL);
@@ -741,21 +737,12 @@ void initJim(void)
add_default_dirs();
- script_len = startup_tcl_len;
- script = malloc(script_len + sizeof(char));
- memcpy(script, startup_tcl, script_len);
-
- /* null terminate */
- script[script_len] = 0;
-
- if (Jim_Eval(interp, script)==JIM_ERR)
+ if (Jim_Eval(interp, startup_tcl)==JIM_ERR)
{
LOG_ERROR("Failed to run startup.tcl (embedded into OpenOCD compile time)");
Jim_PrintErrorMessage(interp);
exit(-1);
}
-
- free(script);
}
int handle_script_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)