Skip to content
Tcl Source Code History Of Ticket ece07271f480ae32
Login

History Of Ticket ece07271f480ae32

Artifacts Associated With Ticket ece07271f480ae32

  1. Ticket change [b5208301f8] (rid 170396) by anonymous on 2019-03-25 12:43:53:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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
      
    5. foundin initialized to: "8.6.9"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9e455d0a8c408635801643661b794ca3d1822d07"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "45. Parsing and Eval"
    15. title initialized to: "Bug in Tcl_ParseArgsObjv() TCL_ARGV_GENFUNC"
    16. type initialized to: "Bug"
  2. Ticket change [016fd1302c] (rid 259685) by serhiy.storchaka on 2026-10-21 09:58:25:

    1. 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.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Duplicate"
    5. status changed to: "Closed"
  3. Ticket change [da2f8957d8] (rid 259984) by serhiy.storchaka on 2026-10-22 17:19:29:

    1. closedate changed to: "2461334.915568831"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"