diff --git a/openmpt123/openmpt123.cpp b/openmpt123/openmpt123.cpp index 8c32ce5817..ba05d385c2 100644 --- a/openmpt123/openmpt123.cpp +++ b/openmpt123/openmpt123.cpp @@ -2184,7 +2184,6 @@ class terminal_ui_guard { static mpt::uint8 main( std::vector args ) { - FILE_mode_guard stdin_text_guard( stdin, FILE_mode::text ); FILE_mode_guard stdout_text_guard( stdout, FILE_mode::text ); FILE_mode_guard stderr_text_guard( stderr, FILE_mode::text ); @@ -2276,7 +2275,8 @@ static mpt::uint8 main( std::vector args ) { [[maybe_unused]] std::optional stdin_guard{ stdin_data ? std::make_optional( stdin, FILE_mode::binary ) : std::nullopt }; [[maybe_unused]] std::optional stdout_guard{ stdout_data ? std::make_optional( stdout, FILE_mode::binary ) : std::nullopt }; - // setup terminal + // setup terminal input + [[maybe_unused]] std::optional stdin_text_guard{ stdin_text ? std::make_optional( stdin, FILE_mode::text ) : std::nullopt }; [[maybe_unused]] std::optional input_guard{ stdin_text && ( flags.mode == Mode::UI ) ? std::make_optional() : std::nullopt }; // choose text output between quiet/stdout/stderr