Tcl Source Code

View Ticket
Login
Ticket UUID: 3556218
Title: string match & glob: close-bracket in character set
Type: Bug Version: obsolete: 8.5.12
Submitter: avl42 Created on: 2012-08-11 00:22:57
Subsystem: 18. Commands M-Z Assigned To: dkf
Priority: 5 Medium Severity:
Status: Open Last Modified: 2012-08-13 06:19:51
Resolution: None Closed By:
    Closed on:
Description:
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.
User Comments: dkf added on 2012-08-13 06:19:51:
See also Bug 219233, for related issues.