summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-08 16:00:46 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-08 16:00:46 +0100
commit165315584d6587e287f54d6c8820e050114b5694 (patch)
treee7827dcce0b96c88614b6882236777023834222f /src/ex_docmd.c
parentd02e508a18346ca1acb8c0c94c38e62a6ddeefe2 (diff)
downloadvim-git-165315584d6587e287f54d6c8820e050114b5694.tar.gz
patch 8.2.0232: the :compiler command causes a crashv8.2.0232
Problem: The :compiler command causes a crash. (Daniel Steinberg) Solution: Do not use the script index if it isn't set.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 645ad0c93..659af1911 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2495,7 +2495,8 @@ do_one_cmd(
#ifdef FEAT_EVAL
// Set flag that any command was executed, used by ex_vim9script().
- if (getline_equal(ea.getline, ea.cookie, getsourceline))
+ if (getline_equal(ea.getline, ea.cookie, getsourceline)
+ && current_sctx.sc_sid > 0)
SCRIPT_ITEM(current_sctx.sc_sid)->sn_had_command = TRUE;
/*