Web lists-archives.com

Re: gawk Regression: CR characters are not stripped on Windows

On Tue, Feb 27, 2018 at 11:48 AM, Andrey Repin <anrdaemon@xxxxxxxxx> wrote:
> Greetings, Orgad Shaneh!
>> 1. The gawk info page states that:
>>> Under MS-Windows,
> ------------^^^^^^^
>>> 'gawk' (and many other text programs) silently
>>> translates end-of-line '\r\n' to '\n' on input and '\n' to '\r\n' on
>>> output.
>> and on Feb 8 the following section was added:
>>> Recent versions of Cygwin open all files in binary mode.  This means
>>> that you should use 'RS = "\r?\n"' in order to be able to handle
>>> standard MS-Windows text files with carriage-return plus line-feed line
>>> endings.
>> This breaks compatibility between different gawk versions. What were
>> the reasons for this change in cygwin, and why was it pushed upstream?
>> 2. Git and other tools automatically convert text files to CRLF on
>> Windows.
> --^^^^^^^
> Cygwin is not "Windows", it is "sort of Linux".
> Besides, this kind silent mangling is dangerous to an unsuspecting user.

I see. This is however not true for MSYS2.

Then I guess we will just keep this as a patch for MSYS2, which is
already merged[1]?

[1] https://github.com/Alexpux/MSYS2-packages/commit/c81d882b9838f8245603c7a8d5f8845eeadd6c2a

- Orgad

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple