diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-17 21:38:25 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-17 21:38:25 +0000 |
commit | 0ef9a5c09482649cf0cc6768ed6fc640b4ed2a0a (patch) | |
tree | ae5d05622365b8043bf3068e07ad48afd64ca8bb | |
parent | 541c87c808df91b55e51fedc4987152a3edfe80d (diff) | |
download | vim-git-0ef9a5c09482649cf0cc6768ed6fc640b4ed2a0a.tar.gz |
patch 9.0.1215: using isalpha() adds dependency on current localev9.0.1215
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)
-rw-r--r-- | src/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/misc1.c | 4 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 64ab24784..e51f84997 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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); diff --git a/src/misc1.c b/src/misc1.c index 019bbaf8d..d369f2aa2 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -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 diff --git a/src/option.c b/src/option.c index 4afb518d1..386cf4d3c 100644 --- a/src/option.c +++ b/src/option.c @@ -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)) { /* diff --git a/src/version.c b/src/version.c index d3eb35a02..5565ccbe9 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1215, +/**/ 1214, /**/ 1213, |