Skip to content
Tcl Source Code History Of Ticket 3556218fffffffff
Login

History Of Ticket 3556218fffffffff

Artifacts Associated With Ticket 3556218fffffffff

  1. Ticket change [14fdddf2a3] (rid 124489) by avl42 on 2012-08-11 00:22:57:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      As of now, it is not possible to include a close-bracket character in a bracketed set of allowed characters.
      [scan]'s format uses bracketed sets of allowed characters, too, and it *does* allow a close-bracket as first char.
      
      Having looked into the implementation of tcl's string-globbing, it seems that *before* entering that loop over the
      bracketed characters, an initial check for ']' in the pattern and in the string to be matched would be a really simple
      fix. Doing it that way, would even still allow a dash to be included verbatim, as well, by placing it right after the
      close-bracket.
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "avl42"
    10. subsystem initialized to: "18. Commands M-Z"
    11. title initialized to:
      string match & glob: close-bracket in character set
      
    12. type initialized to: "Bug"
  2. Ticket change [0fe61ee5c8] (rid 94873) by dkf on 2012-08-13 06:19:51:

    1. foundin changed to: "obsolete: 8.5.12"
    2. icomment:
      See also Bug 219233, for related issues.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  3. Ticket change [fb9c71b0b9] (rid 259305) by serhiy.storchaka on 2026-10-19 17:43:27:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. icomment:
      Still present in 8.6, 9.0 and 9.1: there is no way to include a closing bracket in a set. Backslash is not special inside a set, and <tt><nowiki>{[]a]}</nowiki></tt> never matches anything. The only workaround was a range ending in the closing bracket, which always includes other characters: the narrowest one, <tt><nowiki>{[\-]]}</nowiki></tt>, also matches a backslash. And such ranges are what [219233ffff] removes.
      
      Proposed fix for 9.1 in branch [/timeline?r=glob-bracket-posix|glob-bracket-posix], together with [219233ffff]: a closing bracket right after the opening one is a member of the set, as in POSIX and Python's fnmatch, so <tt><nowiki>{[]a]}</nowiki></tt> matches "]" or "a". Such patterns never matched before, so nothing that works changes. string.n now describes both rules. Test string-11.58.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"