Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Trailing backslash (\) in Windows filename crashes tclsh.exe

Closed / Invalidbfdc5237235fe1d821f009e63ba18ed78446df0dCreated 3 years agoUpdated 3 years ago
Descriptionplain2023-08-04 20:10:56
% file isdirectory {/Users}
1
% file isdirectory {/Users/}
1
% file isdirectory {\Users}
1
% file isdirectory {\Users\}
[hangs]

`file isfile` does the same.

Using tclsh.exe or tclsh86.exe 
in Thomas Perschak's binary tcltk86-8.6.13.5.Win10.nightly.20230729.tgz [https://degitlab-ext.terma.com/tper/tcltk/-/packages/4436]
on Win10 Pro 22H2
chrstphrchvzwiki2023-08-04 22:16:57

Note that many folks do not consider a hang to be a crash.

This does not look like a hang. It instead looks like Tcl is still waiting for the close curly brace signifying the end of the string. The backlash followed by a close curly brace \} is considered to be part of the string. See https://stackoverflow.com/a/44570505/4896937, https://stackoverflow.com/a/32176964/4896937: there is no way to put a single backslash at the end of a curly brace delimited string.

Hope this helps

apnadkarniplain2023-10-05 11:24:08
As Chris stated, Tcl is waiting for the terminating brace, not a bug. Closing.
Log in (anonymous is fine) to add a comment.