tcl version=8.5.7
*** File name list of dir C:/test_bug
0: $[filename].txt
1: $filename.txt
2: [filename].txt
3: filename[1].txt
4: file~name.txt
5: ./~$filename.txt
6: ./~[filename].txt
7: ./~filename.txt
*** Bug test cases
=== 0: normalize=no, path=full File: C:/test_bug/$[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 1: normalize=no, path=full File: C:/test_bug/$filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> can't read "filename": no such variable
[file type [subst -nobackslashes $f]]-> can't read "filename": no such variable
=== 2: normalize=no, path=full File: C:/test_bug/[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 3: normalize=no, path=full File: C:/test_bug/filename[1].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "1"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "1"
=== 4: normalize=no, path=full File: C:/test_bug/file~name.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> file
=== 5: normalize=no, path=full File: C:/test_bug/~$filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> can't read "filename": no such variable
[file type [subst -nobackslashes $f]]-> can't read "filename": no such variable
=== 6: normalize=no, path=full File: C:/test_bug/~[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 7: normalize=no, path=full File: C:/test_bug/~filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> file

=== 0: normalize=yes, path=full File: C:/test_bug/$[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 1: normalize=yes, path=full File: C:/test_bug/$filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> can't read "filename": no such variable
[file type [subst -nobackslashes $f]]-> can't read "filename": no such variable
=== 2: normalize=yes, path=full File: C:/test_bug/[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 3: normalize=yes, path=full File: C:/test_bug/filename[1].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "1"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "1"
=== 4: normalize=yes, path=full File: C:/test_bug/file~name.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> file
=== 5: normalize=yes, path=full File: C:/test_bug/~$filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> can't read "filename": no such variable
[file type [subst -nobackslashes $f]]-> can't read "filename": no such variable
=== 6: normalize=yes, path=full File: C:/test_bug/~[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 7: normalize=yes, path=full File: C:/test_bug/~filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> file

=== 0: normalize=no, path=relative File: $[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 1: normalize=no, path=relative File: $filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> can't read "filename": no such variable
[file type [subst -nobackslashes $f]]-> can't read "filename": no such variable
=== 2: normalize=no, path=relative File: [filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 3: normalize=no, path=relative File: filename[1].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "1"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "1"
=== 4: normalize=no, path=relative File: file~name.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> file
=== 5: normalize=no, path=relative File: ~$filename.txt ===
[file exist $f]-> 0
[file type $f]-> user "$filename.txt" doesn't exist
[file type [subst -novariables $f]]-> user "$filename.txt" doesn't exist
[file type [subst -nocommands $f]]-> can't read "filename": no such variable
[file type [subst -nobackslashes $f]]-> can't read "filename": no such variable
=== 6: normalize=no, path=relative File: ~[filename].txt ===
[file exist $f]-> 0
[file type $f]-> user "[filename].txt" doesn't exist
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> user "[filename].txt" doesn't exist
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 7: normalize=no, path=relative File: ~filename.txt ===
[file exist $f]-> 0
[file type $f]-> user "filename.txt" doesn't exist
[file type [subst -novariables $f]]-> user "filename.txt" doesn't exist
[file type [subst -nocommands $f]]-> user "filename.txt" doesn't exist
[file type [subst -nobackslashes $f]]-> user "filename.txt" doesn't exist

=== 0: normalize=yes, path=relative File: $[filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 1: normalize=yes, path=relative File: $filename.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> can't read "filename": no such variable
[file type [subst -nobackslashes $f]]-> can't read "filename": no such variable
=== 2: normalize=yes, path=relative File: [filename].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "filename"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "filename"
=== 3: normalize=yes, path=relative File: filename[1].txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> invalid command name "1"
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> invalid command name "1"
=== 4: normalize=yes, path=relative File: file~name.txt ===
[file exist $f]-> 1
[file type $f]-> file
[file type [subst -novariables $f]]-> file
[file type [subst -nocommands $f]]-> file
[file type [subst -nobackslashes $f]]-> file
=== 5: normalize=yes, path=relative File: ~$filename.txt ===
Error: [file normalize] failed: user "$filename.txt" doesn't exist
=== 6: normalize=yes, path=relative File: ~[filename].txt ===
Error: [file normalize] failed: user "[filename].txt" doesn't exist
=== 7: normalize=yes, path=relative File: ~filename.txt ===
Error: [file normalize] failed: user "filename.txt" doesn't exist

