X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=eyOgiJhs8lhst48c cbUzhfCkC7SOhNX/7ojXvIcQz2xHuLmy/wrboETsQqC25hHbvr7GnAWJ3+Y+O6VM dUEE+wMX5ExV9qdGg4NY8EhXVCUZp6Vu4qAY8K3Z8wX7x3n8ss/r0diLuFHOxVeI mAUPSepidy6iSIHyNaDdqavCWBw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=default; bh=zoDquKweirgYTGhpaSPKgf ZkiCc=; b=GO7gthi3NGaSf5VTDu9o7g1tk6q9kfihPat5jncspuHbsd8LwdJvjy TFfwhSbDc3WzEFWgmY3EQ5oohsTv54goVFLZISGD28+8qvk/NxmxcE15+zIozae7 j9Hb4Ya6HFivkzDefYs94ISf1Dyvbt5jBScrd/evc6P+IWEcHLpBA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Date: Tue, 27 Feb 2018 12:48:07 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <1354080997.20180227124807@yandex.ru> To: Orgad Shaneh , cygwin AT cygwin DOT 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 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