From a8f259f685ee019141eddbd060de59da81caa846 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sun, 15 Nov 2020 15:15:10 +0100 Subject: [PATCH] Remove unused debug_escape function --- src/common.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/common.cpp b/src/common.cpp index 32fb44b24..4d2521fb4 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1129,43 +1129,6 @@ wcstring escape_string(const wcstring &in, escape_flags_t flags, escape_string_s return result; } -wcstring debug_escape(const wcstring &in) { - wcstring result; - result.reserve(in.size()); - for (wchar_t wc : in) { - auto c = static_cast(wc); - if (c <= 127 && isprint(c)) { - result.push_back(wc); - continue; - } - -#define TEST(x) \ - case x: \ - append_format(result, L"<%s>", #x); \ - break; - switch (wc) { - TEST(HOME_DIRECTORY) - TEST(VARIABLE_EXPAND) - TEST(VARIABLE_EXPAND_SINGLE) - TEST(BRACE_BEGIN) - TEST(BRACE_END) - TEST(BRACE_SEP) - TEST(BRACE_SPACE) - TEST(INTERNAL_SEPARATOR) - TEST(VARIABLE_EXPAND_EMPTY) - TEST(EXPAND_SENTINEL) - TEST(ANY_CHAR) - TEST(ANY_STRING) - TEST(ANY_STRING_RECURSIVE) - TEST(ANY_SENTINEL) - default: - append_format(result, L"<\\x%02x>", c); - break; - } - } - return result; -} - /// Helper to return the last character in a string, or none. static maybe_t string_last_char(const wcstring &str) { if (str.empty()) return none();