summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@gnu.org>2015-01-31 15:23:13 +0100
committerAndreas Gruenbacher <agruen@gnu.org>2015-01-31 22:14:01 +0100
commit8d621e88193c6a5a80081104d9ae4434cff78722 (patch)
tree0cd9fde173cb8006e426b21c031abe24ea8478df
parent290ffcb488bea5caec6d76a34ea8368d00c68875 (diff)
downloadpatch-8d621e88193c6a5a80081104d9ae4434cff78722.tar.gz
Add test case for patch behind symlink
* tests/symlinks: Add a test case where the patch file itself is in a path that follows a symbolic link; we want to continue allowing that.
-rw-r--r--tests/symlinks17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/symlinks b/tests/symlinks
index 2e85da7..8bb83ed 100644
--- a/tests/symlinks
+++ b/tests/symlinks
@@ -259,3 +259,20 @@ check 'echo b > symlink.orig && cat target2' <<EOF
b
EOF
rm -f target2
+
+# --------------------------------------------------------------
+# Make sure we do follow symlinks to patch files.
+
+ncheck 'mkdir d'
+cat > d/ab.diff <<EOF
+--- /dev/null
++++ b/foo
+@@ -0,0 +1 @@
++foo
+EOF
+
+ncheck 'ln -sf d l'
+
+check 'patch -p1 -i l/ab.diff' <<EOF
+patching file foo
+EOF