This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.3.15-1: Patch 2.5 converts DOS newlines to Unix newlines


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@cygwin.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]