Artifacts Associated With Ticket ece07271f480ae32
Ticket change [b5208301f8] (rid 170396) by anonymous on 2019-03-25 12:43:53:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Hi, I was playing with the Tcl_ParseArgsObjv() function and I needed it to do something more specific than what the pre-defined matchers provide. The TCL_ARGV_GENFUNC option seemed like a good solution. However I couldn't get it to work. After some debugging, I believe, I tracked it down to a bug in Tcl_ParseArgsObjv() itself. Currently tcl8.6.9/generic/TclIndexObj.c:1275 is case TCL_ARGV_GENFUNC: { Tcl_ArgvGenFuncProc *handlerProc = (Tcl_ArgvGenFuncProc *)infoPtr->srcPtr; objc = handlerProc(infoPtr->clientData, interp, objc, &objv[srcIndex], infoPtr->dstPtr); if (objc < 0) { goto error; } break; } But I believe it should be case TCL_ARGV_GENFUNC: { Tcl_ArgvGenFuncProc *handlerProc = (Tcl_ArgvGenFuncProc *)infoPtr->srcPtr; int consumed = handlerProc(infoPtr->clientData, interp, objc, &objv[srcIndex], infoPtr->dstPtr); if (consumed < 0) { goto error; } srcIndex += consumed; objc -= consumed; break; } If I read the documentation correctly (https://www.tcl.tk/man/tcl8.6/TclLib/ParseArgs.htm#M14), then the return value of handlerProc indicates how many arguments must be consumed, not how many are still remaining. I verified that tcl8.7a1 still contains the same bug. Wouter - foundin initialized to: "8.6.9"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "9e455d0a8c408635801643661b794ca3d1822d07"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "Bug in Tcl_ParseArgsObjv() TCL_ARGV_GENFUNC"
- type initialized to: "Bug"
Ticket change [016fd1302c] (rid 259685) by serhiy.storchaka on 2026-10-21 09:58:25:
- icomment:
Duplicate of [7cb7409e05]. Fixed by [8cfa5d1ee9] (8.6.15) and [c28a455139] (9.0.0): the handler's return value is now treated as the number of consumed arguments.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Duplicate"
- status changed to: "Closed"
- icomment:
Ticket change [da2f8957d8] (rid 259984) by serhiy.storchaka on 2026-10-22 17:19:29:
- closedate changed to: "2461334.915568831"
- closer changed to: "serhiy.storchaka"
- login: "serhiy.storchaka"