summaryrefslogtreecommitdiff
path: root/tests/symlinks
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@gnu.org>2015-02-21 20:13:04 +0100
committerAndreas Gruenbacher <agruen@gnu.org>2015-03-05 22:57:04 +0100
commitef609c26b22e5d6ea3c891e4c87ab1c679146f5f (patch)
tree54a78b4bc31c5a0898da3e10af5c5b4977774dd5 /tests/symlinks
parent3c58eb50cebe81893b31798a5c8789d392a22288 (diff)
downloadpatch-ef609c26b22e5d6ea3c891e4c87ab1c679146f5f.tar.gz
Follow directory symlinks within the working directory
* src/safe.c (struct symlink): A symlink to resolve. (push_symlink, pop_symlink): New functions. (read_symlink): Create a new symlink stack entry. (traverse_next): Follow ".." components within the working directory. When hitting symlinks, "follow" them by reading and returning them. (traverse_another_path): Recursively traverse symlinks.
Diffstat (limited to 'tests/symlinks')
-rw-r--r--tests/symlinks10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/symlinks b/tests/symlinks
index 4383a49..b4a6f28 100644
--- a/tests/symlinks
+++ b/tests/symlinks
@@ -196,11 +196,15 @@ EOF
check 'patch -f -p1 < follow-symlink.diff || echo "Status: $?"' <<EOF
patching symbolic link dir/foo
-file dir/foo is not a directory
-1 out of 1 hunk ignored
-Status: 1
+patching file dir/foo/bar
+EOF
+
+check 'cat bar' <<EOF
+created in ..
EOF
+rm -f bar
+
cat > bad-symlink-target1.diff <<EOF
diff --git a/bar b/bar
new file mode 120000