Package: patch
Version: 2.6-2

Hi,

since version 2.6 of patch it has a weird behaviour. If the specified
-p parameter is wrong (and the file can therefore not be found) patch
now creates the whole path to the file and some files therein.

Example:
- Lets say you have a directory structure as in:

1/a/b/c/xyz 
2/a/b/c/xyz

(where xyz is a file and both files are different)

- You have a patch that was generated with diff -Nur 1 2 (so
for patch -p0 you would have to apply it from the directory
where the two top level directories 1 and 2 are in)

- You now try to apply the patch from within of '2'
  with the wrong -p0 parameter. 

The result will be:
- 2/2/a/b/c/xyz

I have prepared a small test case that can be used to verify
that. See the attached tarball for the filesystem hierarchy
and the patch.

Just enter the directory test2 and try to apply the patch
with -p0.

Expected result if patch would work correctly:
Ask for the filename to patch as it did in 2.5.x.

Best Regards,
Patrick

Attachment: test_directories.tgz
Description: GNU Unix tar archive

diff -u -Nur test1/a/b/c/xyz test2/a/b/c/xyz
--- test1/a/b/c/xyz	2010-02-03 13:56:38.319392924 +0100
+++ test2/a/b/c/xyz	2010-02-03 13:54:37.886386605 +0100
@@ -0,0 +1 @@
+1

Reply via email to