From 4c8089009d6dae4503fdb13d1f6a03b4434790b2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 12 May 2016 00:00:03 +0100 Subject: [PATCH] Tolerate failure in setting current locale --- src/main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 0ef8c060..994edeee 100644 --- a/src/main.cc +++ b/src/main.cc @@ -706,7 +706,8 @@ int run_pipe(StringView session) int main(int argc, char* argv[]) { - std::locale::global(std::locale("")); + try { std::locale::global(std::locale("")); } + catch (std::runtime_error&) { setlocale(LC_ALL, ""); } set_signal_handler(SIGSEGV, signal_handler); set_signal_handler(SIGFPE, signal_handler);