connection->priv = tclc;
- struct target *target = get_current_target(connection->cmd_ctx);
+ struct target *target = get_current_target_or_null(connection->cmd_ctx);
if (target != NULL)
tclc->tc_laststate = target->state;
retval = tcl_output(connection, result, reslen);
if (retval != ERROR_OK)
return retval;
- /* Always output ctrl-d as end of line to allow multiline results */
+ /* Always output ctrl-z as end of line to allow multiline results */
tcl_output(connection, "\x1a", 1);
}
tcl_port = strdup("6666");
return register_commands(cmd_ctx, NULL, tcl_command_handlers);
}
+
+void tcl_service_free(void)
+{
+ free(tcl_port);
+}