]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1215: using isalpha() adds dependency on current locale v9.0.1215
authorzeertzjq <zeertzjq@outlook.com>
Tue, 17 Jan 2023 21:38:25 +0000 (21:38 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 17 Jan 2023 21:38:25 +0000 (21:38 +0000)
Problem:    Using isalpha() adds dependency on current locale.
Solution:   Do not use isalpha() for recognizing a URL or the end of an Ex
            command. (closes #11835)

src/ex_docmd.c
src/misc1.c
src/option.c
src/version.c

index 64ab247846657a8d55fa4e887c04833b85912a3c..e51f84997de27f9182b59b9dd093279f07fd8538 100644 (file)
@@ -2747,7 +2747,7 @@ checkforcmd_opt(
     for (i = 0; cmd[i] != NUL; ++i)
        if (((char_u *)cmd)[i] != (*pp)[i])
            break;
-    if (i >= len && !isalpha((*pp)[i]) && (*pp)[i] != '_'
+    if (i >= len && !ASCII_ISALPHA((*pp)[i]) && (*pp)[i] != '_'
                         && (!noparen || ((*pp)[i] != '(' && (*pp)[i] != '.')))
     {
        *pp = skipwhite(*pp + i);
index 019bbaf8dd327c0bc094b862d07e35a1a8534513..d369f2aa24d16c1e7c8b57c1f62798c2fa0b2a3a 100644 (file)
@@ -2699,11 +2699,11 @@ path_with_url(char_u *fname)
     // non-URL text.
 
     // first character must be alpha
-    if (!isalpha(*fname))
+    if (!ASCII_ISALPHA(*fname))
        return 0;
 
     // check body: alpha or dash
-    for (p = fname + 1; (isalpha(*p) || (*p == '-')); ++p)
+    for (p = fname + 1; (ASCII_ISALPHA(*p) || (*p == '-')); ++p)
        ;
 
     // check last char is not a dash
index 4afb518d1e86e8e73ac9a058df01999060e395be..386cf4d3c3a5156d04608d2a489bf5215a81a98e 100644 (file)
@@ -1684,7 +1684,7 @@ do_set(
        errmsg = NULL;
        startarg = arg;         // remember for error message
 
-       if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])
+       if (STRNCMP(arg, "all", 3) == 0 && !ASCII_ISALPHA(arg[3])
                                                && !(opt_flags & OPT_MODELINE))
        {
            /*
index d3eb35a0256a1d6f43a808ae55fbb303cc4c323e..5565ccbe974c3cf4320474ded7d205978fb5a7e0 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1215,
 /**/
     1214,
 /**/