vim/backport-patch-8.2.5149-cannot-build-without-the-eval-feature.patch
rwx403335 f897b93c30 Fix CVE-2022-2175
(cherry picked from commit f2b7e60f2f439b69cc05646c60c86b6c00780e19)
2022-07-01 11:11:58 +08:00

49 lines
1.1 KiB
Diff

From 6689df024bce4309ec5884e445738fe07ee4ffcc Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Wed, 22 Jun 2022 18:14:29 +0100
Subject: [PATCH] patch 8.2.5149: cannot build without the +eval feature
Problem: Cannot build without the +eval feature. (Tony Mechelynck)
Solution: Add #ifdefs.
---
src/ex_getln.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 887b47d..8383eee 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -820,7 +820,9 @@ getcmdline_int(
cmdline_info_T save_ccline;
int did_save_ccline = FALSE;
int cmdline_type;
+#ifdef FEAT_EVAL
int save_new_cmdpos;
+#endif
// one recursion level deeper
++depth;
@@ -1758,7 +1760,9 @@ getcmdline_int(
goto returncmd; // back to cmd mode
case Ctrl_R: // insert register
+#ifdef FEAT_EVAL
save_new_cmdpos = new_cmdpos;
+#endif
#ifdef USE_ON_FLY_SCROLL
dont_scroll = TRUE; // disallow scrolling here
#endif
@@ -1816,7 +1820,9 @@ getcmdline_int(
}
#endif
}
+#ifdef FEAT_EVAL
new_cmdpos = save_new_cmdpos;
+#endif
redrawcmd();
goto cmdline_changed;
--
1.8.3.1