Subject: problems with patch.exe
From: [email-masked] (John Garnett)

31 May 1997 19:20:50 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "[email-masked]'" <[email-masked]>
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.995.52
Original-Sender: [email-masked]

I'm using GNU-WIN32 b18 on Windows NT 4.0 with service pack 3 installed.
 I'm trying to
use the 'diff' and 'patch' that come with b18 to create a diff and apply
it via the patch.exe
program.  I can get patch.exe to work for simple diffs and small files
but it dies for larger files.
I saw the same problem with b17.

Here is my test case:

download http://www.cygnus.com/misc/gnu-win32/index.html to a file.

copy index.html index2.html

delete line number 17 from index2.html (or any line for that matter)

D:\TEMP>copy index.html index2.html
        1 file(s) copied.

D:\TEMP>vi index2.html

D:\TEMP>where diff.exe
d:\cygnus\H-i386-cygwin32\bin\diff.exe

D:\TEMP>diff -cr index.html index2.html > diff

D:\TEMP>type diff
*** index.html  Sat May 31 18:28:56 1997
--- index2.html Sat May 31 18:29:12 1997
***************
*** 14,20 ****

  <font face="Verdana, Arial, Helvetica">

- <h1>The GNU-Win32 Project Page</h1>

  The GNU-Win32 tools are ports of the popular GNU development
  tools to Windows NT/95 for the x86 and PowerPC processors.
--- 14,19 ----

D:\TEMP>patch < diff

Hmm...  Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** index.html Sat May 31 18:28:56 1997
|--- index2.html        Sat May 31 18:29:12 1997
--------------------------
Patching file index.html using Plan B...
Hunk #1 failed at 14.
1 out of 1 hunks failed--saving rejects to index.html.rej
Hmm...  Ignoring the trailing garbage.
done

D:\TEMP>diff index.html index2.html
Binary files index.html and index2.html differ

..........

Not only does the patch fail but index.html is garbled and diff
considers it a binary file even though diff
worked fine on index.html before 'patch' was used.

Has anyone else seen this problem?  Does someone have a solution?  This
is quite frustrating.

Thanks,

John Garnett
[email-masked]

Here is some version information and checksum info:

D:\TEMP>where sum.exe
d:\cygnus\H-i386-cygwin32\bin\sum.exe

D:\TEMP>sum d:\cygnus\h-i386-cygwin32\bin\patch.exe
08609    13

D:\TEMP>sum d:\cygnus\h-i386-cygwin32\bin\diff.exe
08623     2

D:\TEMP>diff -v
diff - GNU diffutils version 2.7

D:\TEMP>patch -v
Patch version 2.1

D:\TEMP>where diff.exe
d:\cygnus\H-i386-cygwin32\bin\diff.exe

D:\TEMP>where patch.exe
d:\cygnus\H-i386-cygwin32\bin\patch.exe
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".