Skip to content

Commit 0ef9a5c

Browse files
zeertzjqbrammool
authored andcommitted
patch 9.0.1215: using isalpha() adds dependency on current locale
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)
1 parent 541c87c commit 0ef9a5c

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2747,7 +2747,7 @@ checkforcmd_opt(
27472747
for (i = 0; cmd[i] != NUL; ++i)
27482748
if (((char_u *)cmd)[i] != (*pp)[i])
27492749
break;
2750-
if (i >= len && !isalpha((*pp)[i]) && (*pp)[i] != '_'
2750+
if (i >= len && !ASCII_ISALPHA((*pp)[i]) && (*pp)[i] != '_'
27512751
&& (!noparen || ((*pp)[i] != '(' && (*pp)[i] != '.')))
27522752
{
27532753
*pp = skipwhite(*pp + i);

src/misc1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,11 +2699,11 @@ path_with_url(char_u *fname)
26992699
// non-URL text.
27002700

27012701
// first character must be alpha
2702-
if (!isalpha(*fname))
2702+
if (!ASCII_ISALPHA(*fname))
27032703
return 0;
27042704

27052705
// check body: alpha or dash
2706-
for (p = fname + 1; (isalpha(*p) || (*p == '-')); ++p)
2706+
for (p = fname + 1; (ASCII_ISALPHA(*p) || (*p == '-')); ++p)
27072707
;
27082708

27092709
// check last char is not a dash

src/option.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ do_set(
16841684
errmsg = NULL;
16851685
startarg = arg; // remember for error message
16861686

1687-
if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])
1687+
if (STRNCMP(arg, "all", 3) == 0 && !ASCII_ISALPHA(arg[3])
16881688
&& !(opt_flags & OPT_MODELINE))
16891689
{
16901690
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1215,
698700
/**/
699701
1214,
700702
/**/

0 commit comments

Comments
 (0)