summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-09-06 20:56:56 +0200
committerBram Moolenaar <Bram@vim.org>2021-09-06 20:56:56 +0200
commitddfc05100a29263a682dd96bb924dfde4354a654 (patch)
treeb30efee7b9f80ea356d3fe9de194888d312e4979 /src/userfunc.c
parent3b318513561b5862944769188ae4af6b70311838 (diff)
downloadvim-git-ddfc05100a29263a682dd96bb924dfde4354a654.tar.gz
patch 8.2.3408: can delete a numbered functionv8.2.3408
Problem: Can delete a numbered function. (Naohiro Ono) Solution: Disallow deleting a numbered function. (closes #8760)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index aa55bc85e..e51df51ff 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4669,6 +4669,13 @@ ex_delfunction(exarg_T *eap)
if (eap->nextcmd != NULL)
*p = NUL;
+ if (isdigit(*name) && fudi.fd_dict == NULL)
+ {
+ if (!eap->skip)
+ semsg(_(e_invarg2), eap->arg);
+ vim_free(name);
+ return;
+ }
if (!eap->skip)
fp = find_func(name, is_global, NULL);
vim_free(name);