mirror/sed — pull request #1 by john-peterson (2013-05-06 18:30:26+00:00)
Title: ﻿Fixing Cygwin read mode

#### References

http://sourceware.org/bugzilla/show_bug.cgi?id=14597

#### Purpose

Removing the \r\n → \n conversion.

The goal is to have the same behavior in Cygwin as in Linux.

#### Discussion

Reasons to disable LF ↔ CRLF conversion by default

* It's off by default in Linux and script writers will sometimes not consider Cygwin compatibility.
* There are Windows editors that support LF newlines.
* The conversion is probably less commonly desired than not desired.

#### Test case

Previous version

printf "\r\n"|sed -e's, , ,'|cat -A -
$

This version

printf "\r\n"|./sed -e's, , ,'|cat -A -
^M$

#### Additional notes

Conversions done by text read and write

* `rt`	`\r\n` → `\n`
* `wt`	`\n` → `\r\n`

`t` in `rt`/`wt` is equivalent to `O_TEXT`