This is the mail archive of the
mailing list for the Cygwin project.
Re: gawk Regression: CR characters are not stripped on Windows
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Orgad Shaneh <orgads at gmail dot com>, cygwin at cygwin dot com
- Date: Tue, 27 Feb 2018 12:48:07 +0300
- Subject: Re: gawk Regression: CR characters are not stripped on Windows
- Authentication-results: sourceware.org; auth=none
- Authentication-results: smtp3o.mail.yandex.net; dkim=pass email@example.com
- References: <CAGHpTB+bfbts=fOBSQPN7c-NDh8FTXR+EauhDhiVrqbgawcYoA@mail.gmail.com>
- Reply-to: cygwin at cygwin dot com
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
> 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
> 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
Cygwin is not "Windows", it is "sort of Linux".
Besides, this kind silent mangling is dangerous to an unsuspecting user.
> This means that any awk script that runs on both platforms
> must use RS = "\r?\n". One example that was broken by this behavior
> change is gerrit's commit-msg hook, which scans for empty lines by
> /^$/ regexp.
With best regards,
Tuesday, February 27, 2018 12:44:21
Sorry for my terrible english...
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple