summaryrefslogtreecommitdiff
path: root/lldb/source/Core/IOHandlerCursesGUI.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2020-06-19 19:17:24 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-06-19 19:17:56 +0200
commitf5eaa2afe2a9faa2d05ca46e006e770d17c32778 (patch)
tree315db107d4cd813a2a0c531997d93b2807bc0c89 /lldb/source/Core/IOHandlerCursesGUI.cpp
parent8340fbb9c7bc9ea5f3b636ec3c449ff87d88fd9d (diff)
[lldb] Replace std::isprint/isspace with llvm's locale-independent version
Summary: LLVM is using its own isPrint/isSpace implementation that doesn't change depending on the current locale. LLDB should do the same to prevent that internal logic changes depending on the set locale. Reviewers: JDevlieghere, labath, mib, totally_not_teemperor Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D82175
Diffstat (limited to 'lldb/source/Core/IOHandlerCursesGUI.cpp')
-rw-r--r--lldb/source/Core/IOHandlerCursesGUI.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index c5f365973c40..49e93cd11dd1 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -919,7 +919,7 @@ void Menu::DrawMenuTitle(Window &window, bool highlight) {
const attr_t hilgight_attr = A_REVERSE;
if (highlight)
window.AttributeOn(hilgight_attr);
- if (isprint(shortcut_key)) {
+ if (llvm::isPrint(shortcut_key)) {
size_t lower_pos = m_name.find(tolower(shortcut_key));
size_t upper_pos = m_name.find(toupper(shortcut_key));
const char *name = m_name.c_str();
@@ -948,7 +948,7 @@ void Menu::DrawMenuTitle(Window &window, bool highlight) {
window.AttributeOff(hilgight_attr);
if (m_key_name.empty()) {
- if (!underlined_shortcut && isprint(m_key_value)) {
+ if (!underlined_shortcut && llvm::isPrint(m_key_value)) {
window.AttributeOn(COLOR_PAIR(3));
window.Printf(" (%c)", m_key_value);
window.AttributeOff(COLOR_PAIR(3));
@@ -2715,7 +2715,7 @@ static const char *CursesKeyToCString(int ch) {
case KEY_ESCAPE:
return "escape";
default:
- if (isprint(ch))
+ if (llvm::isPrint(ch))
snprintf(g_desc, sizeof(g_desc), "%c", ch);
else
snprintf(g_desc, sizeof(g_desc), "\\x%2.2x", ch);