summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Takata <kentkt@csc.jp>2023-10-20 11:54:05 +0200
committerChristian Brabandt <cb@256bit.org>2023-10-20 11:57:08 +0200
commitac709e2fc0db6d31abb7da96f743c40956b60c3a (patch)
treea87defed1c43c7317bbf12ea39b991cc31d3baf5 /src
parentd5dc58aeed1b3e76527685d04906afd634d45949 (diff)
patch 9.0.2054: win32: iscygpty needs updatev9.0.2054
Problem: win32: iscygpty needs update Solution: Update iscygpty to the latest version, make use iswascii() API function Import the latest version from https://github.com/k-takata/ptycheck. This addresses #13332 for iscygpty() closes: #13392 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ken Takata <kentkt@csc.jp>
Diffstat (limited to 'src')
-rw-r--r--src/iscygpty.c12
-rw-r--r--src/version.c2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/iscygpty.c b/src/iscygpty.c
index 9dded85485..9976f067c7 100644
--- a/src/iscygpty.c
+++ b/src/iscygpty.c
@@ -2,7 +2,7 @@
* iscygpty.c -- part of ptycheck
* https://github.com/k-takata/ptycheck
*
- * Copyright (c) 2015-2017 K.Takata
+ * Copyright (c) 2015-2023 K.Takata
*
* You can redistribute it and/or modify it under the terms of either
* the MIT license (as described below) or the Vim license.
@@ -116,7 +116,7 @@ int is_cygpty(int fd)
return 0;
#else
HANDLE h;
- int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * (MAX_PATH - 1);
+ const int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * (MAX_PATH - 1);
FILE_NAME_INFO *nameinfo;
WCHAR *p = NULL;
@@ -135,7 +135,7 @@ int is_cygpty(int fd)
return 0;
}
// Check the name of the pipe:
- // '\{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master'
+ // "\\{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master"
if (pGetFileInformationByHandleEx(h, FileNameInfo, nameinfo, size)) {
nameinfo->FileName[nameinfo->FileNameLength / sizeof(WCHAR)] = L'\0';
p = nameinfo->FileName;
@@ -147,7 +147,8 @@ int is_cygpty(int fd)
p = NULL;
}
if (p != NULL) {
- while (*p && isxdigit(*p)) // Skip 16-digit hexadecimal.
+ // Skip 16-digit hexadecimal.
+ while (*p && iswascii(*p) && isxdigit(*p))
++p;
if (is_wprefix(p, L"-pty")) {
p += 4;
@@ -156,7 +157,8 @@ int is_cygpty(int fd)
}
}
if (p != NULL) {
- while (*p && isdigit(*p)) // Skip pty number.
+ // Skip pty number.
+ while (*p && iswascii(*p) && isdigit(*p))
++p;
if (is_wprefix(p, L"-from-master")) {
//p += 12;
diff --git a/src/version.c b/src/version.c
index fa01991436..6616d07716 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2054,
+/**/
2053,
/**/
2052,