summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-16 13:35:13 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-16 13:35:13 +0100
commit5acd9872580a12ca1138275bf65d1cb9349e2a53 (patch)
tree5a16f122fbc1383b13f654e3b86e15b09314ca70 /src/terminal.c
parentd634024b90c7ae6ff08c1970646f1bca91f5611f (diff)
downloadvim-git-5acd9872580a12ca1138275bf65d1cb9349e2a53.tar.gz
patch 8.1.0929: no error when requesting ConPTY but it's not availablev8.1.0929
Problem: No error when requesting ConPTY but it's not available. Solution: Add an error message. (Hirohito Higashi, closes #3967)
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 714cb2bcb..899d3b687 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -5620,10 +5620,8 @@ void (WINAPI *pDeleteProcThreadAttributeList)(LPPROC_THREAD_ATTRIBUTE_LIST);
static int
dyn_conpty_init(int verbose)
{
- static BOOL handled = FALSE;
- static int result;
- HMODULE hKerneldll;
- int i;
+ static HMODULE hKerneldll = NULL;
+ int i;
static struct
{
char *name;
@@ -5642,16 +5640,17 @@ dyn_conpty_init(int verbose)
{NULL, NULL}
};
- if (handled)
- return result;
-
if (!has_conpty_working())
{
- handled = TRUE;
- result = FAIL;
+ if (verbose)
+ emsg(_("E982: ConPTY is not available"));
return FAIL;
}
+ // No need to initialize twice.
+ if (hKerneldll)
+ return OK;
+
hKerneldll = vimLoadLib("kernel32.dll");
for (i = 0; conpty_entry[i].name != NULL
&& conpty_entry[i].ptr != NULL; ++i)
@@ -5661,12 +5660,11 @@ dyn_conpty_init(int verbose)
{
if (verbose)
semsg(_(e_loadfunc), conpty_entry[i].name);
+ hKerneldll = NULL;
return FAIL;
}
}
- handled = TRUE;
- result = OK;
return OK;
}
@@ -6015,6 +6013,7 @@ dyn_winpty_init(int verbose)
{
if (verbose)
semsg(_(e_loadfunc), winpty_entry[i].name);
+ hWinPtyDLL = NULL;
return FAIL;
}
}