[10477] in Athena Bugs

home help back first fref pref prev next nref lref last post

vax 7.4H: patch

daemon@ATHENA.MIT.EDU (cfields@Athena.MIT.EDU)
Thu Apr 29 14:54:22 1993

From: cfields@Athena.MIT.EDU
To: bugs@Athena.MIT.EDU
Date: Thu, 29 Apr 93 14:54:06 EDT

System name:		get-a-life
Type and version:	CVAXSTAR 7.4H
Display type:		SM

What were you trying to do?

	I was trying to patch an empty file to contain one
	newline. Here's an example:

		Make the files...

	athena% touch foo
	athena% echo -n "\^J" > bar1

		Generate the diffs...

	athena% diff -c foo bar1 > pat

		Now get ready to patch. bar1 is the file to be patched.

	athena% mv foo bar1
	athena% patch < pat
	Hmm...  Looks like a new-style context diff to me...
	The text leading up to this was:
	--------------------------
	|*** foo        Thu Apr 29 14:39:09 1993
	|--- bar1       Thu Apr 29 14:39:18 1993
	--------------------------
	(Creating file foo...)
	Patching file foo using Plan A...
	Hunk #1 succeeded at 1.
	done

What's wrong:

	Patch created "foo" and put a newline in it, instead of
	patching "bar1" to include a newline.

	You may wonder why my files are called "foo" and "bar1"
	instead of "foo" and "bar". This is because patch works
	correctly if the two filenames are of the same length.

	Hopefully the bug isn't also dependent on moon phase.

What should have happened:

	Patch should have core dumped rather than producing an
	incorrect result.

Please describe any relevant documentation references:

	patch(1), _The Hitchhiker's Guide to the Galaxy_

home help back first fref pref prev next nref lref last post