Overview
| Artifact ID: | 6bad4e2b7be491b493aefee0a0b5502f9f060228930f500924fe68131b9a37f4 |
|---|---|
| Ticket: | 4c5a98f5a0d4ae30a0f1bb4d76592f3ba3551bd1
gets with -translation auto merges lines after a "\r" at the end of a read |
| User & Date: | jan.nijtmans on 2026-11-22 22:56:47 |
Changes
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2461367.4561011572"
- closer changed to: "jan.nijtmans"
- 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.
- icomment:
Merged to [1bcbef3166|trunk], core-9-0-branch and core-8-6-branch Many thanks!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"