Skip to content
Tcl Source Code History Of Ticket 4c5a98
Login

History Of Ticket 4c5a98

Artifacts Associated With Ticket 4c5a98

  1. Ticket change [973cabdbd3] (rid 258309) by serhiy.storchaka on 2026-10-16 21:38:18:

    1. cmimetype initialized to: "text/x-fossil-wiki"
    2. comment initialized to:
      With <nowiki>-translation auto</nowiki>, if a read ends with "\r" and the next read has no end of line, a "\n" at the start of a later read is dropped as if it were the LF of a CRLF pair:
      
      <verbatim>
      lassign [chan pipe] r w
      fconfigure $r -blocking 0 -translation auto
      fconfigure $w -translation binary -buffering none
      puts -nonewline $w "a\r"; gets $r      ;# a
      puts -nonewline $w "b"; gets $r        ;# (blocked)
      puts -nonewline $w "\nc\n"; gets $r    ;# bc  (8.6.12: b, then c)
      </verbatim>
      
      LF CR input loses empty lines in the same way. Since [a3ed092aab] (8.6.13, the fix for [b3977d199b]) Tcl_GetsObj() resets INPUT_SAW_CR only when an end of line is found.
      
    3. foundin initialized to: "8.6.18, 9.0.5, 9.1.0"
    4. login: "serhiy.storchaka"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. severity initialized to: "Minor"
    8. status initialized to: "Open"
    9. submitter initialized to: "serhiy.storchaka"
    10. subsystem initialized to: "25. Channel System"
    11. title initialized to:
      gets with -translation auto merges lines after a "\r" at the end of a read
      
    12. type initialized to: "Bug"
  2. Ticket change [104c2074aa] (rid 258314) by serhiy.storchaka on 2026-10-16 21:40:49:

    1. icomment:
      Proposed fix in branch [/timeline?r=gets-auto-saw-cr|gets-auto-saw-cr]: Tcl_GetsObj() resets INPUT_SAW_CR as soon as data follows the "\r" and sets it again if the skipped "\n" is pushed back, so the torn CRLF case of [b3977d199b] still works (io-29.36.1, io-29.36.2). Test io-29.36.3.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [6bad4e2b7b] (rid 262030) by jan.nijtmans on 2026-11-22 22:56:47:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2461367.4561011572"
    3. closer changed to: "jan.nijtmans"
    4. comment changed to:
      With <nowiki>-translation auto</nowiki>, if a read ends with "\r" and the next read has no end of line, a "\n" at the start of a later read is dropped as if it were the LF of a CRLF pair:
      
      <verbatim>
      lassign [chan pipe] r w
      fconfigure $r -blocking 0 -translation auto
      fconfigure $w -translation binary -buffering none
      puts -nonewline $w "a\r"; gets $r      ;# a
      puts -nonewline $w "b"; gets $r        ;# (blocked)
      puts -nonewline $w "\nc\n"; gets $r    ;# bc  (8.6.12: b, then c)
      </verbatim>
      
      LF CR input loses empty lines in the same way. Since [a3ed092aab] (8.6.13, the fix for [b3977d199b]) Tcl_GetsObj() resets INPUT_SAW_CR only when an end of line is found.
      
    5. icomment:
      Merged to [1bcbef3166|trunk], core-9-0-branch and core-8-6-branch
      
      Many thanks!
      
    6. login: "jan.nijtmans"
    7. mimetype: "text/x-fossil-wiki"
    8. resolution changed to: "Fixed"
    9. status changed to: "Closed"