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: Fri, 4 Mar 2005 23:37:34 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: Bug diff 2.8.7: Separate dir In-Reply-To: <4228F306.C1B09E85@dessent.net> Message-ID: References: <20050304230549 DOT DF5187EC3 AT mail DOT phys DOT uu DOT nl> <4228F306 DOT C1B09E85 AT dessent DOT net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 4 Mar 2005, Brian Dessent wrote: > Arend-Jan Westhoff wrote: > > > > Noticed that when diff is run with two differing files, > > one with and one without a directory specifier: > > diff a someDir\b > > then all lines are reported as different. > > Whereas when both have a directory specifier: > > diff .\a someDir\b > > output is normal. > > (Filenames, argument order or using -d seem irrelevant. > > Using / instead of \ makes output normal also: > > diff a someDir/b > > output is normal. > > Similarly when comparing a and someDir\a as: > > diff a someDir > > output is also normal. > > ) > > I cannot reproduce this, either from a bash prompt or from cmd using > your .bat file: I can reproduce this (even under bash). All you need is a textmode mount and files with CRLF line endings. > It's probably a textmode/binmode issue, though I don't know why > switching between '\' and '/' as the path seperator changes it -- > although the Cygwin path handling code is complex and I can't pretend to > understand it. Having a '\' in a filename bypasses Cygwin's mounts and uses regular Windows mechanisms for opening the file. Reading a file on a textmode mount will translate CRLF line endings to normal LFs. No wonder 'diff' is confused. > There was no attached cygcheck so I don't know how your mounts are setup > but from what I've read, using textmode mounts with tools like cvs and > diff is a recipe for disaster. Yep. One possible workaround is to use the '--strip-trailing-cr' option to diff, which will make it insensitive to textmode/binmode line endings. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "The Sun will pass between the Earth and the Moon tonight for a total Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT -- 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/