From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120268 invoked by alias); 27 Feb 2018 09:50:09 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 120180 invoked by uid 89); 27 Feb 2018 09:50:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*F:D*yandex.ru, H*M:yandex, H*x:Bat!, H*UA:Bat! X-HELO: forward100o.mail.yandex.net Received: from forward100o.mail.yandex.net (HELO forward100o.mail.yandex.net) (37.140.190.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Feb 2018 09:50:05 +0000 Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 907CE2A21BE1; Tue, 27 Feb 2018 12:50:02 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WqMtKTk1Od-o2AWCUZ9; Tue, 27 Feb 2018 12:50:02 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6QvwxbAM3w-o1k8B70t; Tue, 27 Feb 2018 12:50:02 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 27 Feb 2018 09:48:07 -0000 Date: Tue, 27 Feb 2018 09:50:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1354080997.20180227124807@yandex.ru> To: Orgad Shaneh , cygwin@cygwin.com Subject: Re: gawk Regression: CR characters are not stripped on Windows In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00282.txt.bz2 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. > 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[1], which scans for empty lines by > /^$/ regexp. -- With best regards, Andrey Repin Tuesday, February 27, 2018 12:44:21 Sorry for my terrible english... -- 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