Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Thu, 6 May 2004 10:08:53 +0200 From: Corinna Vinschen To: cygwin AT sources DOT redhat DOT com Cc: cygwin AT cygwin DOT com Subject: Re: newline in patch command output Message-ID: <20040506080853.GD12047@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT sources DOT redhat DOT com, cygwin AT cygwin DOT com References: <20040505125151 DOT GA20299 AT ata DOT cs DOT hacettepe DOT edu DOT tr> <4098F133 DOT FF888288 AT dessent DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4098F133.FF888288@dessent.net> User-Agent: Mutt/1.4.2i On May 5 06:50, Brian Dessent wrote: > Baurjan Ismagulov wrote: > > > > Hello, > > > > I wish to use diff and patch on files with CR/LF newlines. I've > > installed cygwin with DOS text file type. Diff produced a patch with > > CR/LF. When I try to apply this patch, the modified files contain only > > LF, and I have to run unix2dos on them. How can I make patch produce > > output files with CR/LF in DOS mode? > > > > I've tried to search this in google and list archives, but "patch" > > brought too many false hits :( . > > patch is a tricky area in terms of line-endings. This is mostly > explained in . > Patch can read in either binmode or textmode (depending on the mount and > presense of --binary) but it always writes its output in binmode, which > is what causes your CRs to go away. Corinna might be able to clarify > why this must be so. I'm not sure if it "must", but it's the solution which costs as few grief as possible. I tried various combinations but in the end, writing all output files in binary was the only one to stop patch to screw up files in one way or the other. Since you can be sure that patch creates always LF files, I don't see a problem in using unix2dos on them afterwards. It's reliable. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Co-Project Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/