aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/ex_docmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 6361267d9b..4ef332186e 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -8654,7 +8654,10 @@ eval_vars (
break;
case SPEC_AFILE: // file name for autocommand
- if (autocmd_fname != NULL && !path_is_absolute(autocmd_fname)) {
+ if (autocmd_fname != NULL
+ && !path_is_absolute(autocmd_fname)
+ // For CmdlineEnter and related events, <afile> is not a path! #9348
+ && !strequal("/", (char *)autocmd_fname)) {
// Still need to turn the fname into a full path. It was
// postponed to avoid a delay when <afile> is not used.
result = (char_u *)FullName_save((char *)autocmd_fname, false);