aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/fileio.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 6a13548027..115d34c3ea 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -5369,10 +5369,21 @@ void vim_deltempdir(void)
/// Creates the directory on the first call.
char *vim_gettempdir(void)
{
- if (vim_tempdir == NULL) {
+ static int notfound = 0;
+ bool exists = false;
+ if (vim_tempdir == NULL || !(exists = os_isdir(vim_tempdir))) {
+ if (vim_tempdir != NULL && !exists) {
+ notfound++;
+ if (notfound == 1) {
+ ELOG("tempdir disappeared (antivirus or broken cleanup job?): %s", vim_tempdir);
+ }
+ if (notfound > 1) {
+ msg_schedule_semsg("E5431: tempdir disappeared (%d times)", notfound);
+ }
+ XFREE_CLEAR(vim_tempdir);
+ }
vim_mktempdir();
}
-
return vim_tempdir;
}