Save errno before using sprintf, ifstream.

std::ifstream in libstdc++ contains a bug, where it sets errno to zero.
To work around it, we manually save the errno before using std::ifstream
in debugger check, and reset it after we are done.

We also preventively save errno before using sprintf.

Fixes #835
This commit is contained in:
Martin Hořeňovský
2017-03-06 21:51:22 +01:00
parent e95bf48445
commit 613e1466f9
4 changed files with 34 additions and 0 deletions

View File

@@ -135,6 +135,7 @@ set(INTERNAL_HEADERS
${HEADER_DIR}/internal/catch_debugger.h
${HEADER_DIR}/internal/catch_debugger.hpp
${HEADER_DIR}/internal/catch_default_main.hpp
${HEADER_DIR}/internal/catch_errno_guard.hpp
${HEADER_DIR}/internal/catch_evaluate.hpp
${HEADER_DIR}/internal/catch_exception_translator_registry.hpp
${HEADER_DIR}/internal/catch_expression_lhs.hpp