summaryrefslogtreecommitdiff
path: root/src/patch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/patch.c')
-rw-r--r--src/patch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/patch.c b/src/patch.c
index a60e631..b0ed91a 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -176,6 +176,12 @@ main (int argc, char **argv)
/* Make sure we clean up in case of disaster. */
set_signals (false);
+ /* When the file to patch is specified on the command line, allow that file
+ to lie outside the current working tree. Still doesn't allow to follow
+ symlinks. */
+ if (inname)
+ unsafe = true;
+
if (inname && outfile)
{
/* When an input and an output filename is given and the patch is