delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/08/10:37:36

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 8 Nov 2002 16:37:17 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.3.15-1: Patch 2.5 converts DOS newlines to Unix newlines
Message-ID: <20021108163717.O21920@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <3DCBCCAA DOT 40403 AT earthlink DOT net>
Mime-Version: 1.0
In-Reply-To: <3DCBCCAA.40403@earthlink.net>
User-Agent: Mutt/1.3.22.1i

On Fri, Nov 08, 2002 at 09:39:38AM -0500, Steve Chapel wrote:
>    diff -u orig new > diff
>    patch -R < diff
> Now the files orig and new should be identical, but diff shows that
> every line in the files is different. The difference is that the file
> new now has Unix style newlines instead of DOS style newlines.

This is intentional.  Patch(1) has no mechanisms to recognize a file
being a DOS or a Unix file.  It just doesn't care (as Unix apps typically
do).  A bunch of patches to patch allow to use DOS input and patch files
randomly intermixed but the output is Unix centric.  It still doesn't care.

It's one of these tricky problems for which there is no 100% correct
solution.  Imagine the input file is a DOS file and the patch file is a
Unix file.  What format should the output file have?  And what if the
situation is the other way around?  And what if an input file has partly
DOS and partly Unix line endings?  See what I mean?

So on Cygwin the output file is playfully created with the line endings
given by the mount mode of the output file's path.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019