This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8125

-- gerrit

commit 6b769dfaccfbbc1a0cb400af61ea5ce65084545c
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Thu Feb 1 10:55:51 2024 +0100

    jtag: fix jtag configure command containing events
    
    Commit ea2e26f7d521 ("jtag: rewrite jim_jtag_configure() as
    COMMAND_HANDLER") breaks the option -event if it is the last of
    the command line.
    This can be tested, even without any device connected, through:
            #> openocd -f board/ti_cc26x0_launchpad.cfg
            wrong # args: should be "-event <event-name> <event-body>"
    
    Fix the check on available arguments after -event.
    
    Change-Id: Iec1522238f906d61a888a09a7685acd9ac6442a7
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>
    Reported-by: Lorenz Brun <lor...@brun.one>
    Fixes: ea2e26f7d521 ("jtag: rewrite jim_jtag_configure() as 
COMMAND_HANDLER")

diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 163edfa19e..7995529018 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -315,7 +315,7 @@ __COMMAND_HANDLER(handle_jtag_configure)
                const struct nvp *n = nvp_name2value(nvp_config_opts, 
CMD_ARGV[i]);
                switch (n->value) {
                case JCFG_EVENT:
-                       if (i + (is_configure ? 3 : 2) >= CMD_ARGC) {
+                       if (i + (is_configure ? 2 : 1) >= CMD_ARGC) {
                                command_print(CMD, "wrong # args: should be 
\"-event <event-name>%s\"",
                                                is_configure ? " <event-body>" 
: "");
                                return ERROR_COMMAND_ARGUMENT_INVALID;

-- 

Reply via email to