bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with newlines in diff and patch


From: Paul Eggert
Subject: Re: Problems with newlines in diff and patch
Date: Tue, 29 Oct 2002 11:29:06 -0800 (PST)

> From: Steve Chapel <address@hidden>
> Date: Tue, 29 Oct 2002 12:31:31 -0500
> 
> 1. I would expect that diff reports only where the files are different. 
> In fact, diff reports that the end of the files are somehow different, 
> when they are not.

Yes, they are different: linkToolbarHandler.js has a newline
just before EOF, whereas linkToolbarHandler.js.bak lacks one.

> 2. I would expect that the patch command would change the file 
> linkToolbarHandler.js to be identical to linkToolbarHandler.js.bak.

It works for me:

   $ diff -u linkToolbarHandler.js.bak linkToolbarHandler.js > diff
   $ patch -p0 -R <diff
   patching file linkToolbarHandler.js
   $ cmp linkToolbarHandler.js.bak.old linkToolbarHandler.js
   $ 

> In fact, every newline in the file linkToolbarHandler.js is altered,

Altered how?  Is it a LF versus CRLF problem?

> If either of these problems is actually a problem with cygwin and not 
> with diff or patch, or if there is an easy workaround for these 
> problems, please let me know.

Looks like a Cygwin problem to me.  Something with binary file mode,
perhaps?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]