mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 03:08:27 +00:00
vim-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 vim/vim#11835)
0ef9a5c094
This commit is contained in:
@@ -1768,7 +1768,7 @@ int path_with_url(const char *fname)
|
||||
// non-URL text.
|
||||
|
||||
// first character must be alpha
|
||||
if (!isalpha((uint8_t)(*fname))) {
|
||||
if (!ASCII_ISALPHA(*fname)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1777,7 +1777,7 @@ int path_with_url(const char *fname)
|
||||
}
|
||||
|
||||
// check body: alpha or dash
|
||||
for (p = fname + 1; (isalpha((uint8_t)(*p)) || (*p == '-')); p++) {}
|
||||
for (p = fname + 1; (ASCII_ISALPHA(*p) || (*p == '-')); p++) {}
|
||||
|
||||
// check last char is not a dash
|
||||
if (p[-1] == '-') {
|
||||
|
Reference in New Issue
Block a user