aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r--src/nvim/charset.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 37e7e6516b..da65839353 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -1438,7 +1438,7 @@ char_u* skipdigits(char_u *q)
char_u* skiphex(char_u *q)
{
char_u *p = q;
- while (vim_isxdigit(*p)) {
+ while (ascii_isxdigit(*p)) {
// skip to next non-digit
p++;
}
@@ -1468,27 +1468,13 @@ char_u* skiptodigit(char_u *q)
char_u* skiptohex(char_u *q)
{
char_u *p = q;
- while (*p != NUL && !vim_isxdigit(*p)) {
+ while (*p != NUL && !ascii_isxdigit(*p)) {
// skip to next digit
p++;
}
return p;
}
-/// Variant of isxdigit() that can handle characters > 0x100.
-/// We don't use isxdigit() here, because on some systems it also considers
-/// superscript 1 to be a digit.
-///
-/// @param c
-///
-/// @return TRUE if the character is a digit.
-int vim_isxdigit(int c)
-{
- return (c >= '0' && c <= '9')
- || (c >= 'a' && c <= 'f')
- || (c >= 'A' && c <= 'F');
-}
-
// Vim's own character class functions. These exist because many library
// islower()/toupper() etc. do not work properly: they crash when used with
// invalid values or can't handle latin1 when the locale is C.
@@ -1751,7 +1737,7 @@ void vim_str2nr(char_u *start, int *hexp, int *len, int dooct, int dohex,
if (dohex
&& ((hex == 'X') || (hex == 'x'))
- && vim_isxdigit(ptr[2])) {
+ && ascii_isxdigit(ptr[2])) {
// hexadecimal
ptr += 2;
} else {
@@ -1785,7 +1771,7 @@ void vim_str2nr(char_u *start, int *hexp, int *len, int dooct, int dohex,
}
} else if ((hex != 0) || (dohex > 1)) {
// hex
- while (vim_isxdigit(*ptr)) {
+ while (ascii_isxdigit(*ptr)) {
un = 16 * un + (unsigned long)hex2nr(*ptr);
ptr++;
}