From f5eaa2afe2a9faa2d05ca46e006e770d17c32778 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Fri, 19 Jun 2020 19:17:24 +0200 Subject: [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 --- lldb/source/Core/IOHandlerCursesGUI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/source/Core/IOHandlerCursesGUI.cpp') 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); -- cgit v1.2.3