aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-03-24 11:10:01 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-03-24 12:16:39 +0100
commit82cd0be2eaf71c0476e15c66ba3e83c76896d407 (patch)
tree870b2448151069c8ebb825911f032d6c8a1cb4d3 /src/nvim/ex_docmd.c
parent189c5abeba4fb508d879ebbf5fa07965c4092cf2 (diff)
downloadrneovim-82cd0be2eaf71c0476e15c66ba3e83c76896d407.tar.gz
rneovim-82cd0be2eaf71c0476e15c66ba3e83c76896d407.tar.bz2
rneovim-82cd0be2eaf71c0476e15c66ba3e83c76896d407.zip
refactor: eliminate `autocmd_fname_full` global
It's a micro-optimization; check path_is_absolute_path(autocmd_fname) instead. The main optimization (which is still in place) afforded by Vim 7.2.021 was to avoid resolving <afile> when it is not needed.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 51f11b7b56..a0966dc1fc 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -8546,11 +8546,10 @@ eval_vars (
resultbuf = result; /* remember allocated string */
break;
- case SPEC_AFILE: /* file name for autocommand */
- if (autocmd_fname != NULL && !autocmd_fname_full) {
+ case SPEC_AFILE: // file name for autocommand
+ if (autocmd_fname != NULL && !path_is_absolute_path(autocmd_fname)) {
// Still need to turn the fname into a full path. It was
// postponed to avoid a delay when <afile> is not used.
- autocmd_fname_full = true;
result = (char_u *)FullName_save((char *)autocmd_fname, false);
// Copy into `autocmd_fname`, don't reassign it. #8165
xstrlcpy((char *)autocmd_fname, (char *)result, MAXPATHL);