Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2012-09-28
22:34 • Closed ticket [3570790fff]: exec << truncates at NUL plus 6 other ch... artifact: 32c8023cf4 user: dgp
22:20 • Open ticket [3570790fff]. artifact: 08fa1f5c6b user: andygoth
22:16 • Pending ticket [3570790fff]. artifact: 730a8ded9c user: dgp
2012-09-23
09:20 • Ticket [3570790fff]: 4 changes artifact: f267685e83 user: dkf
2012-09-22
21:01 • New ticket [3570790fff]. artifact: 328b8e1a93 user: andygoth

[exec <<] truncates at NUL

Closed / Out of Date3570790fffffffffffffffffffffffffffffffffCreated 14 years agoUpdated 14 years ago
Descriptionplain2012-09-22 21:01:27
The "<<" [exec] redirection operator truncates its operand at the first NUL.  Similar does not happen when writing to an [open |] channel.

% exec xxd << ab\0cd
0000000: 6162                                     ab
% exec xxd << ab\1cd
0000000: 6162 0163 64                             ab.cd
% set chan [open |xxd a+]; puts -nonewline $chan ab\0cd; close $chan write; read $chan
0000000: 6162 0063 64                             ab.cd
dkfplain2012-09-23 09:20:26
Relates to http://tip.tcl.tk/259.html
dgpplain2012-09-28 22:16:48
This is fixed in 8.5.12 and 8.6b3 .  You must not really be
testing what you think you are testing.  Use [package present Tcl]
to confirm.

% package present Tcl
8.6b3
% exec xxd << ab\0cd
0000000: 6162 0063 64                             ab.cd
%
andygothplain2012-09-28 22:20:46
Sorry for picking the wrong version, I meant 8.6b2.  Also I tested on 8.4.something, forget exactly what, but it was nowhere close to the latest 8.4.
dgpplain2012-09-28 22:34:40
allow_comments - 1
Log in (anonymous is fine) to add a comment.