Closed effelsberg closed 10 years ago
At least in teapot.tcl I found some occurrences of such code (more places may exist):
teapot.tcl
foreach {code path} [exec $teacup link info $teapot] { . . . use |code| and |path| }
Now the problem. What exec returns is a string like this:
exec
Shell c:\tcl\bin\tclsh86.exe
When interpreted as a list like foreach does implicitly you'll get:
foreach
code: Shell path: c: cin clsh86.exe
The gaps are tabs and the 'l' of 'tcl' has been eaten by a backspace.
I suggest you use proper splits (for newlines and then spaces) to separate the contents of what exec returns.
split
Thank you! I'll look into it; it might be a little more involved since the path could contain spaces. I'll have to see what happens in that case.
At least in
teapot.tcl
I found some occurrences of such code (more places may exist):Now the problem. What
exec
returns is a string like this:When interpreted as a list like
foreach
does implicitly you'll get:The gaps are tabs and the 'l' of 'tcl' has been eaten by a backspace.
I suggest you use proper
split
s (for newlines and then spaces) to separate the contents of whatexec
returns.