diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-07-24 20:46:15 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-07-24 20:46:15 +0000 |
commit | 1ac48e7500b88a82cd7e455c74dae4028bb03e11 (patch) | |
tree | a9c3ca0abc9f26e19edfa57a069d0d1f3d0f6942 /src/helper | |
parent | 74eb754abcb49bd8a61b42398ba80d1a895a4604 (diff) | |
download | openocd_libswd-1ac48e7500b88a82cd7e455c74dae4028bb03e11.tar.gz openocd_libswd-1ac48e7500b88a82cd7e455c74dae4028bb03e11.tar.bz2 openocd_libswd-1ac48e7500b88a82cd7e455c74dae4028bb03e11.tar.xz openocd_libswd-1ac48e7500b88a82cd7e455c74dae4028bb03e11.zip |
OpenOCD commands w/prefix ocd_ now set the primary Tcl return value instead of messing with ocd_output local variable. Much more straightforward and expected behaviour. The side effect is that the ocd_xxx commands will print output twice(once immediately and once upon completion of command). This is a strange, expected and intentional behaviour.
git-svn-id: svn://svn.berlios.de/openocd/trunk@871 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/command.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index 5ac57a1e..d31bb6ec 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -115,7 +115,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv) log_remove_callback(tcl_output, tclOutput); /* We dump output into this local variable */ - Jim_SetVariableStr(interp, "ocd_output", tclOutput); + Jim_SetResult(interp, tclOutput); Jim_DecrRefCount(interp, tclOutput); for (i = 0; i < nwords; i++) @@ -205,7 +205,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char free((void *)full_name); /* we now need to add an overrideable proc */ - const char *override_name=alloc_printf("proc %s%s%s {args} {return [eval \"ocd_%s%s%s $args\"]}", t1, t2, t3, t1, t2, t3); + const char *override_name=alloc_printf("proc %s%s%s {args} {eval \"ocd_%s%s%s $args\";return \"\"}", t1, t2, t3, t1, t2, t3); Jim_Eval(interp, override_name); free((void *)override_name); |