]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2054: win32: iscygpty needs update v9.0.2054
authorKen Takata <kentkt@csc.jp>
Fri, 20 Oct 2023 09:54:05 +0000 (11:54 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 20 Oct 2023 09:57:08 +0000 (11:57 +0200)
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>
src/iscygpty.c
src/version.c

index 9dded854859d7f173dc69ea4666c222458b2b079..9976f067c7a86ae8b606084c5ae43c694586d389 100644 (file)
@@ -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;
index fa01991436dd71e991438f93b6248553c8d0fa3e..6616d077169894679aeb447eabcb68916cf13f9a 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2054,
 /**/
     2053,
 /**/