Overview
| Artifact ID: | 973cabdbd387fdcaf1f25efd32aad88fe7feae87d1f1b0cf3b4a8873f75ef951 |
|---|---|
| Ticket: | 4c5a98f5a0d4ae30a0f1bb4d76592f3ba3551bd1
gets with -translation auto merges lines after a "\r" at the end of a read |
| User & Date: | serhiy.storchaka on 2026-10-16 21:38:18 |
Changes
- cmimetype changed to: "text/x-fossil-wiki"
- 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.
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- login: "serhiy.storchaka"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "serhiy.storchaka"
- subsystem changed to: "25. Channel System"
- title changed to:
gets with -translation auto merges lines after a "\r" at the end of a read
- type changed to: "Bug"