From: Bram Moolenaar <Bram@vim.org>
Date: Sat, 3 Nov 2018 19:06:25 +0100
Subject: patch 8.1.0506: modeline test fails when run by root

Problem:    Modeline test fails when run by root.
Solution:   Set 'modeline' for the test. (James McCoy, closes #3592)

(cherry picked from commit 9691f82f862ed18c2e3e48f9d2cd902bb947f803)

Signed-off-by: James McCoy <jamessan@debian.org>
---
 src/testdir/test_modeline.vim | 5 ++++-
 src/version.c                 | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/testdir/test_modeline.vim b/src/testdir/test_modeline.vim
index f02c68c..3bde58d 100644
--- a/src/testdir/test_modeline.vim
+++ b/src/testdir/test_modeline.vim
@@ -1,9 +1,12 @@
 " Tests for parsing the modeline.
 
 func Test_modeline_invalid()
-  " This was reading before allocated memory.
+  " This was reading allocated memory in the past.
   call writefile(['vi:0', 'nothing'], 'Xmodeline')
+  let modeline = &modeline
+  set modeline
   call assert_fails('split Xmodeline', 'E518:')
+  let &modeline = modeline
   bwipe!
   call delete('Xmodeline')
 endfunc
diff --git a/src/version.c b/src/version.c
index 05b04ac..0e63969 100644
--- a/src/version.c
+++ b/src/version.c
@@ -1195,6 +1195,8 @@ static int included_patches[] =
  */
 static char *(extra_patches[]) =
 {   /* Add your patch description below this line */
+/**/
+    "8.1.0506",
 /**/
     "8.1.0208",
 /**/
