File: patch-8.1.0506-modeline-test-fails-when-run-by-root.patch

package info (click to toggle)
vim 2%3A8.0.0197-4%2Bdeb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 60,600 kB
  • sloc: ansic: 320,650; cpp: 4,144; makefile: 3,536; perl: 1,179; awk: 715; sh: 682; xml: 526; lisp: 501; cs: 458; python: 410; asm: 114; csh: 6
file content (46 lines) | stat: -rw-r--r-- 1,400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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",
 /**/