This is for tclhttpd 3.5.1.
In lib/dirlist.tcl:180, a directory listing is created with the following glob line:
set list [glob -nocomplain -- [file join $dir $pattern]]
This fails if the $dir contains characters that are glob sensitive as show below, such as if the directory name contains []. Using [glob -directory] option seems to fix this.
% set dir {c:/temp/[a]/}
c:/temp/[a]/
% set pattern *
*
% glob -nocomplain -- [file join $dir $pattern]
% glob -- [file join $dir $pattern]
no files matched glob pattern "c:/temp/[a]/*"
% glob -nocomplain -directory $dir -- $pattern
{c:/temp/[a]/1} {c:/temp/[a]/2}
%
I tried this on OSX with ActiveTcl 8.5 and I do not see the error. I did the following from within tclsh:
% mkdir \[temp\]
% set pattern *
% set dir /path/to/the/dir/with/[temp]
% glob -nocomplain -- [file join $dir $pattern]
I get a directory list from the glob with the [temp] directory as well. No errors.
What version of Tcl?
What OS?