Menu

#5114 [exec <<] truncates at NUL

obsolete: 8.6b3
closed-out-of-date
5
2012-09-28
2012-09-22
Andy Goth
No

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

Discussion

  • Donal K. Fellows

     
  • Don Porter

    Don Porter - 2012-09-28

    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
    %

     
  • Don Porter

    Don Porter - 2012-09-28
    • assigned_to: dkf --> dgp
    • status: open --> pending-out-of-date
     
  • Andy Goth

    Andy Goth - 2012-09-28

    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.

     
  • Andy Goth

    Andy Goth - 2012-09-28
    • status: pending-out-of-date --> open-out-of-date
     
  • Don Porter

    Don Porter - 2012-09-28
    • status: open-out-of-date --> closed-out-of-date