[comp.binaries.ibm.pc.d] PC Patch: how to get it to work

creps@silver.UUCP (05/12/88)

   Earlier I wrote that the Unix patch program I ported to MS-DOS
did not work properly when applied to files in MS-DOS format, and
so forth. I also theorized a temporary fix for the problem, that is,
to convert the target file back to Unix format.

   With the crlf program I sent to Rahul today to be posted soon this
method should work. I tried this method, and was able to succesfully
patch a file that patch bombed on when it was in MS-DOS format.

   First run the file to be patched through crlf:
crlf -r file.ext > ufile.ext

   The -r option tells crlf we are converting from MS-DOS format to
Unix format. Output is redirected to ufile.ext, which will be the same
file, but in Unix format. If you examine the sizes of these two files,
the size of file.ext should be roughly equal to the size of ufile.ext +
the number of lines in the file.

  You may now apply your patches to ufile.ext. You'll probably have to
delete file.ext (or move it somewhere else), then rename ufile.ext to
file.ext. The patch can be applied as follows:
patch <patchfile

   I have also found another bug in patch which I believe is caused by the
limit DOS places on the number of files open at the same time. You may
get an error message telling you patch can't open a file if your patch
file contains patches for more than three or four different files. The
temporary solution to this is to split the patchfile into smaller files,
split, of course, at file boundaries.

  I also recently reported a bug to comp.sources.bugs about the cdiff
program that was posted there months ago. I included a DOS executable
of this program with the patch executable. It seems that the cdiff
program doesn't work properly when given a file in Unix format. You
should be aware of this, or the lines in the resulting diff file can
get off by a line in some places. So, make sure the file is in MS-DOS
format before using the diff that came with patch, but make sure a
file is in Unix format before using patch. Anyone confused yet?

-	-	-	-	-	-	-	-	-	-
Steve Creps, Indiana University, Bloomington, home of the "Hoosiers"
	creps@silver.bacs.indiana.edu (192.12.206.2)
	{pur-ee,ihnp4!inuxc,rutgers,pyramid}!iuvax!silver!creps
	creps@iubacs.bitnet (forwarded)
"To dream... the unlintable dream..."