Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5d426133ccda68311d310f01680f1f59940e0b0f
Ticket: 218524ffffffffffffffffffffffffffffffffff
every 4096th char is changed to a carriage return
User & Date: nobody on 2000-10-26 01:01:40
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 887 Bug
    Version: 8.1a2
    SubmitDate: '1998-12-02'
    LastModified: '1999-11-04'
    Severity: CRIT
    Status: Released
    Submitter: admin
    ChangedBy: hershey
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '1999-11-04'
    FixedInVersion: 8.1b1
    ClosedDate: '2000-10-25'
    
    
    I have discovered the following problem in both tcl8.1a2 and the net
    distribution of tcl8.1. Basically, if you write out more than 4096 bytes of
    data that has carriage returns in it to a channel which has been
    fconfigured to have translation crlf, it will change every 4096th character
    to a carriage return.
    
    Syd Polk
    
    The following script illustrates the problem:
    
    # Test 1 - Case that works
    set bigstring {}
    
    for {set i 0} {$i < 10000} {incr i} {
    append bigstring "0"
    }
    
    set f [open foo.out w]
    fconfigure $f -translation crlf
    puts $f $bigstring nonewline
    close $f
    
    set f [open foo.out]
    fconfigure $f -translation crlf
    set readstring [read $f]
    close $f
    catch {file delete -force foo.out}
    
    if {[string compare $bigstring $readstring] != 0} {
    puts "Test 1 did not work"
    }
    
    # Test 2 - Fails
    
    set bigstring {}
    
    for {set i 0} {$i < 10000} {incr i} {
    append bigstring "000000000\n"
    }
    
    set f [open foo.out w]
    fconfigure $f -translation
    crlf
    puts $f $bigstring nonewline
    close $f
    
    set f [open foo.out]
    fconfigure
    $f -translation crlf
    set readstring [read $f]
    close $f
    catch {file delete
    -force foo.out}
    
    if {[string compare $bigstring $readstring] != 0} {
    puts "Test 2 did not work"
    }
    
    
    Fixed... 
    -- 11/04/1999 hershey
    
  4. foundin changed to: "obsolete: 8.1a2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "57. zlib"
  10. title changed to: "every 4096th char is changed to a carriage return"
  11. type changed to: "Bug"