diff options
author | Neil <nyamatongwe@gmail.com> | 2019-01-13 16:30:28 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-01-13 16:30:28 +1100 |
commit | 7927d7da0bbc485a142426bd6dbb9d6db8c2c105 (patch) | |
tree | eebfa2cbc98b556001bf4cb8a0df4aeeef9bfa33 /src | |
parent | 468e18f0fab0cd0bc2e2a9944c02317e9ea828af (diff) | |
download | scintilla-mirror-7927d7da0bbc485a142426bd6dbb9d6db8c2c105.tar.gz |
Backport: Replace the only use of a function from <cctype> with a Scintilla function.
Remove inclusion of <cctype> except in lexers as cctype functions often behave
poorly and may crash for out of bounds arguments.
Backport of changeset 7228:348e55f8107c.
Diffstat (limited to 'src')
-rw-r--r-- | src/CharClassify.cxx | 5 | ||||
-rw-r--r-- | src/EditView.cxx | 1 | ||||
-rw-r--r-- | src/Editor.cxx | 1 | ||||
-rw-r--r-- | src/MarginView.cxx | 1 |
4 files changed, 3 insertions, 5 deletions
diff --git a/src/CharClassify.cxx b/src/CharClassify.cxx index ba8433e62..5ae47a2ef 100644 --- a/src/CharClassify.cxx +++ b/src/CharClassify.cxx @@ -6,10 +6,11 @@ // The License.txt file describes the conditions under which this software may be distributed. #include <cstdlib> -#include <cctype> +#include <cassert> #include <stdexcept> +#include "CharacterSet.h" #include "CharClassify.h" using namespace Scintilla; @@ -25,7 +26,7 @@ void CharClassify::SetDefaultCharClasses(bool includeWordClass) { charClass[ch] = ccNewLine; else if (ch < 0x20 || ch == ' ') charClass[ch] = ccSpace; - else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_')) + else if (includeWordClass && (ch >= 0x80 || IsAlphaNumeric(ch) || ch == '_')) charClass[ch] = ccWord; else charClass[ch] = ccPunctuation; diff --git a/src/EditView.cxx b/src/EditView.cxx index 29ff92501..3143134d2 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -9,7 +9,6 @@ #include <cstdlib> #include <cassert> #include <cstring> -#include <cctype> #include <cstdio> #include <cmath> diff --git a/src/Editor.cxx b/src/Editor.cxx index 045266604..563b3a665 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -9,7 +9,6 @@ #include <cstdlib> #include <cassert> #include <cstring> -#include <cctype> #include <cstdio> #include <cmath> diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 3662c7eef..8473974ba 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -9,7 +9,6 @@ #include <cstdlib> #include <cassert> #include <cstring> -#include <cctype> #include <cstdio> #include <cmath> |