summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/diff.c6
-rw-r--r--src/testdir/test_diffmode.vim15
-rw-r--r--src/version.c2
3 files changed, 22 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c
index a46f0bf81..187376710 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1310,6 +1310,9 @@ ex_diffpatch(exarg_T *eap)
else
#endif
{
+ if (check_restricted())
+ goto theend;
+
// Build the patch command and execute it. Ignore errors. Switch to
// cooked mode to allow the user to respond to prompts.
vim_snprintf((char *)buf, buflen, "patch -o %s %s < %s",
@@ -1380,7 +1383,8 @@ ex_diffpatch(exarg_T *eap)
// Do filetype detection with the new name.
if (au_has_group((char_u *)"filetypedetect"))
- do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
+ do_cmdline_cmd(
+ (char_u *)":doau filetypedetect BufRead");
}
}
}
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index d60de5046..cb042e115 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -736,6 +736,21 @@ func Test_diffpatch()
bwipe!
endfunc
+" FIXME: test fails, the Xresult file can't be read
+func No_Test_diffpatch_restricted()
+ let lines =<< trim END
+ call assert_fails('diffpatch NoSuchDiff', 'E145:')
+
+ call writefile(v:errors, 'Xresult')
+ qa!
+ END
+ call writefile(lines, 'Xrestricted', 'D')
+ if RunVim([], [], '-Z --clean -S Xrestricted')
+ call assert_equal([], readfile('Xresult'))
+ endif
+ call delete('Xresult')
+endfunc
+
func Test_diff_too_many_buffers()
for i in range(1, 8)
exe "new Xtest" . i
diff --git a/src/version.c b/src/version.c
index 5cace2e38..853ea5f18 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1440,
+/**/
1439,
/**/
1438,