Skip to content
Tcl Source Code History Of Ticket a7c1c2c7e5
Login

History Of Ticket a7c1c2c7e5

Artifacts Associated With Ticket a7c1c2c7e5

  1. Ticket change [71d17fb295] (rid 184022) by zhou on 2020-06-20 07:08:43:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      The document of lsearch command says: This command searches the elements of list to see if one of them matches pattern. If so, the command returns the index of the first matching element (unless the options -all or -inline are specified.) If not, the command returns -1. The option arguments indicates how the elements of the list are to be matched against pattern and must have one of the values below: 
      
      But if you specify the -all option and there is no matches found, the lsearch command returns an empty string instead of -1.
      
    5. foundin initialized to: "8.6.8"
    6. is_private initialized to: "0"
    7. login: "zhou"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "c76aa1c4f5b5ad6fa0c50aac05cee1be8566f7a1"
    10. resolution initialized to: "None"
    11. severity initialized to: "Severe"
    12. status initialized to: "Open"
    13. submitter initialized to: "zhou"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to:
      lsearch with -all options does not return -1 where no match is found
      
    16. type initialized to: "Bug"
  2. Ticket change [48041000cf] (rid 184030) by jan.nijtmans on 2020-06-21 15:43:18:

    1. closedate changed to: "2459022.15507875"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Maybe surprising, but - apparently - this is exactly as expected. The documentation of "-all" says: "Changes the result to be the list of all matching indices". Since there is no match, the list of all matching indices is empty and that's what's returned.
      
      The documentation you state also contains "(unless the options -all or -inline are specified.)". So, the command only returns -1 for no match is neither -all nor -inline is specified. So - my conclusion - is: This is as originally designed, and it's as it should be. So, marking this one as "Invalid", since it works as designed.
      
      However, I adapted the documentation a little bit, clarify this confusion.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"