[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-patch] Using wrong filename when adding new file
From: |
Tim Waugh |
Subject: |
[bug-patch] Using wrong filename when adding new file |
Date: |
Tue, 22 Dec 2009 11:18:01 +0000 |
I reported this at savannah.gnu.org but I'm not sure if that's the
correct place.
With patch-2.6, this sequence of commands give the wrong output:
rm -rf a b
mkdir a b
touch a/file
echo content > b/file.new
diff -u a/file b/file.new > test.patch
mkdir c
cd c
patch -p1 -i ../test.patch
ls
Basically, when a unified context diff looks like:
--- a/file
+++ b/file.new
@@ -0,0 +1 @@
+content
and the patch is applied in an empty directory, the filename from the
'+++' line is used when it should be the filename from the '---' line
instead. "a/file" is a "better" name than "b/file.new", going by the
POSIX algorithm.
This behaviour is new in patch-2.6.
Tim.
*/
signature.asc
Description: This is a digitally signed message part
- [bug-patch] Using wrong filename when adding new file,
Tim Waugh <=